Skip to content

Instantly share code, notes, and snippets.

@alexhwoods
Created January 21, 2020 19:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexhwoods/26cf943d0e698bc775a949a3e18ab724 to your computer and use it in GitHub Desktop.
Save alexhwoods/26cf943d0e698bc775a949a3e18ab724 to your computer and use it in GitHub Desktop.
Export a mysql query to a CSV
mysql -h <host-name> -D <database-name> -u <username> --password=<password> -e "SELECT 1;" | tr '\t' ',' >> output.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment