logo_mysql_sun_a

I was asked to export some data in a csv format from a Mysql database. I’m just putting it here as a reminder… Thank you so much my blog to extend my brain capacity so much !

SELECT * INTO OUTFILE '/tmp/result.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM dc_account_key WHERE created_at > '2009-01-09' AND active = 0;

I won’t explain this, it’s really straitforward. This is just a reminder, after all.