MySql: query result in csv file using command

Form the mysql prompt use the below command:

SELECT * FROM table_name
INTO OUTFILE '/tmp/table_name.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
Advertisements
MySql: query result in csv file using command

2 thoughts on “MySql: query result in csv file using command

  1. This is so great that I had to comment. I’m usually just a lurker, taking in knowledge and nodding my head in quiet approval at the good stuff…..this required written props. Theory rocks…thanks.

    Like

  2. Great, I have already bookmarked your this page…Now I don’t have enough time for read but by reading beginning part I must say…it was a positive start .. Would love to read further too…Thanks for great post!

    Like

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 )

Google+ photo

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

Connecting to %s