Subscribe to RSS Subscribe to Comments

Alan Blaine Whitney

SQL CSV Export

Nothing new here, but had forgot how easy it is to export to csv in mysql

SELECT * INTO OUTFILE 'result.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM my_table;

Note that this file will be created on the mysql server, not the client.

No comments yet. Be the first.

Leave a reply

Based on FluidityTheme Redesigned by Kaushal Sheth Sponsored by Send Flowers