Created
June 23, 2009 22:35
-
-
Save sr3d/134895 to your computer and use it in GitHub Desktop.
Dump a table to a CSV file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -h HOST -u USERNAME --password=PASSWORD DATABASE -B -e "SELECT id,email,first_name,last_name,state,zip_code FROM users" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > filename.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment