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!

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: