Search This Blog

Sunday, November 17, 2013

Out put a result of a MySQL query into a CSV file

Out put a result of a MySQL query into a CSV file

SELECT  * FROM m_table INTO OUTFILE '/tmp/orders.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';