Archive for July, 2008

Exporting a Mysql table to a CSV file

Friday, July 25th, 2008

select * into outfile ‘temp.csv’
fields terminated by ‘,’ optionally enclosed by ‘”‘
lines terminated by ‘\n’
from tablename;

File outputs in:

/var/lib/mysql/tablename/temp.csv