Mar23

Written by:David Aldridge
3/23/2011 2:06 PM 

To export data from a select query to a csv file, you use the following style of select query:

select * from mytable
into outfile '/var/lib/mysql/outfile.csv'
fields terminated by ','
enclosed by '"'
lines terminated by '\n';

where your output will end up in /var/lib/mysql/outfile.csv.
 

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment  Cancel 
You must be logged in and have permission to create or edit a blog.