How to export table to CSV in MySQL with title code example
Example: mysql output csv
-- If you are using linux,
SELECT id, filename
FROM attachments
INTO OUTFILE '/tmp/results.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
-- and find the csv file /tmp