I am trying to export a table from a remote server to a desktop computer in csv format. I have this code:
select * from order into outfile 'C:\Users\Sleep Shop\Desktop\MySQL Scripts/outfile.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n';
but I get this error:
failed: cannot create / write to file '/ var / lib / mysql / C: \ Users \ Sleep Shop \ Desktop \ MySQL Scripts / outfile.csv' (error code: 2)
I think that there is something fundamental that I do not understand in this procedure, probably something that needs to be done for a table located on a remote server. Can anybody help?
I used this code to indicate the location on the server to create the file:
select * from orders into outfile '/var/www/test/outfile.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n';
It creates a file but contains no entries, and I get this error:
fail: The field separator argument is not as expected;
source share