Mysqldump in CSV format

Posted on 2012-08-20
Last Modified: 2012-08-20
I need to dump ALL tables in mysql in CSV format.

Is there a command using mysqldump to JUST output every row for every table in CSV format?
Question by:phpzilla
    LVL 15

    Expert Comment

    by:David L. Hansen
    Here is one solution:;1
    It is called sqltotxt (it is free to try but costs $60 to use full-featured).

    There is also this solution (which is free but a little messier).  If you are comfortable dabbling in sql scripts this may be the way to go.
    LVL 24

    Accepted Solution

    No need for a 3rd party software you can still use just mysqldump.  Use the -T option to write delimited files then the --fields-terminated-by=, to set the delimiter to comma.  Something like:

    mysqldump -u username -p -t -T/where/you/want/to/write/the/files database_name --fields-terminated-by=,

    Note that this only works if you run mysqldump on the same machine as the MySQL server.

    See for more info.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (, A SQLite Tidbit: Quick Numbers Table Generation (…
    More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video discusses moving either the default database or any database to a new volume.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now