Skip to content

Instantly share code, notes, and snippets.

@carltondickson
Created August 13, 2014 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carltondickson/f53c9e675a3d3e35366e to your computer and use it in GitHub Desktop.
Save carltondickson/f53c9e675a3d3e35366e to your computer and use it in GitHub Desktop.
MySQL select certain data into data dump
# Following needs the file permission, double check you look on the DB server to find the outfile!
SELECT .. INTO OUTFILE '/home/foo/myfile.csv'
# If no file permission try command line instead
mysql -e "SELECT * FROM foo ORDER BY bar" > '/path/to/file'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment