When I try to create a CSV file from a MySQL DB using ruby no file is created and no error is returned. This is on a Windows 10 machine.
Here is my code:
def dump_csv
Dir.mkdir 'C:\temp' unless File.exists? 'C:\temp'
<<-SQL
SELECT *
FROM #{@table}
GROUP BY a, b, c, d
HAVING COUNT(*) < 40
INTO OUTFILE 'C:\\\\temp\\\\temp.csv'
FIELDS TERMINATED BY ','
SQL
end
I know it's not a permission error, because if I input that statement into MySQL directly it works just fine. Any ideas? Or another way of going about it?
Thanks!