Export a table into csv format

Here is an example to export data from MySQL into CSV File Format.

SELECT * INTO OUTFILE ‘/tmp/file_name.csv’ FIELDS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY ‘”‘ LINES TERMINATED BY ‘n’ FROM table_name;

Permanent link to this article: https://blog.openshell.in/2010/12/export-a-table-into-csv-format/

Leave a Reply

Your email address will not be published.