Skip to content

Instantly share code, notes, and snippets.

@Narven
Created February 5, 2013 21:51
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 Narven/4718084 to your computer and use it in GitHub Desktop.
Save Narven/4718084 to your computer and use it in GitHub Desktop.
gzip's a mysql table directly
mysql --host={DB host} --user={user} --password={password} --quick -e {sql} | sed \'s/\t/","/g;s/^/"/;s/$/"/\' | gzip -9 -c > {file}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment