Last active
January 10, 2018 08:42
-
-
Save arsu-leo/0853fc50d14d22559467cd24c08f029a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 -u[user] -p[password] -h[host] --database=[database] --batch -e "SQL QUERY FROM X" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > export.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Credits:
https://stackoverflow.com/questions/356578/how-to-output-mysql-query-results-in-csv-format