Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Mysqldump in CSV format

Posted on 2012-08-20
2
Medium Priority
?
1,087 Views
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?
0
Comment
Question by:phpzilla
2 Comments
 
LVL 15

Expert Comment

by:David L. Hansen
ID: 38313400
Here is one solution:
http://download.cnet.com/SqlToTxt/3000-2247_4-10872060.html?tag=mncol;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.
0
 
LVL 24

Accepted Solution

by:
johanntagle earned 2000 total points
ID: 38314230
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 http://www.electrictoolbox.com/using-mysqldump-to-save-data-to-csv-files/ for more info.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

571 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