Skip to content

Instantly share code, notes, and snippets.

@btbytes
Created June 11, 2009 17:37
Show Gist options
  • Save btbytes/128095 to your computer and use it in GitHub Desktop.
Save btbytes/128095 to your computer and use it in GitHub Desktop.
Export into a CSV file from MySQL
-- Export into a CSV file from MySQL
SELECT * from foologger
INTO OUTFILE '/tmp/rrr.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n';
where dfd=2 and logtime >= '2009-06-08 05:00:00' and logtime <='2009-06-08 17:00:00'
and qhr=1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment