Skip to content

Instantly share code, notes, and snippets.

@seabre
Created April 4, 2012 18:55
Show Gist options
  • Save seabre/2304737 to your computer and use it in GitHub Desktop.
Save seabre/2304737 to your computer and use it in GitHub Desktop.
Export Table as CSV From MySQL

#Export Table as CSV From MySQL

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment