Skip to content

Instantly share code, notes, and snippets.

@pstaender
Created December 5, 2016 14:25
Show Gist options
  • Save pstaender/337f28fd54137dc0a84ba8bd2e70f268 to your computer and use it in GitHub Desktop.
Save pstaender/337f28fd54137dc0a84ba8bd2e70f268 to your computer and use it in GitHub Desktop.
mysqldump to csv
mysql -B -u username -p password database -h dbhost -e "SELECT * FROM accounts;" \ | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment