I\'m trying to write the results of a query to a file using mysql. I\'ve seen some information on the outfile construct in a few places but it seems that this only writes the fi
You could try this, if you want to write MySQL query result in a file.
This example write the MySQL query result into a csv file with comma separated format
csv
SELECT id,name,email FROM customers INTO OUTFILE '/tmp/customers.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'