Skip to content

Command line tool (binaries available for download) for exporting MySQL query results to CSV files.

Notifications You must be signed in to change notification settings

mitcelab/mysql2csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mysql2csv

It's surprisingly hard to export a MySQL query to a CSV file. You can use SELECT ... INTO OUTFILE ... but that requires special file permissions; on the other hand, third-party clients such as MySQL Workbench and SequelPro are slow and often run into encoding problems.

install

go install github.com/mitcelab/mysql2csv

usage

mysql2csv --user X --pass Y --host Z --dbname btctalk --query "SELECT * FROM User"

By default, it prints to STDOUT where you can easily pipe it through gzip/bzip2, but you can also specify a output file with the --output option.

About

Command line tool (binaries available for download) for exporting MySQL query results to CSV files.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published