Dump MySQL table into CSV

I needed to dump MySQL tables into CSV for use with WEKA. A little google search helped. I found this. I am copying the command here for my reference:

SELECT * INTO OUTFILE ‘result.csv’
FIELDS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY ‘”‘
LINES TERMINATED BY ‘\n’
FROM my_table;

Thank you, Terminally Incoherent! I love MySQL too!

Leave a comment