2008-10-29

Exporting a database in human-readable form from mysql

Using mysqldump with the defaults results in huge INSERT statements that can be hard to deal with if you're fiddling with the output by hand; this command dumps a database in a more readable format:

mysqldump -u root -p -h hostname.dns --databases databasetodump --skip-extended-insert --complete-insert > database.sql

Of course, replace the italic words with the ones that apply to you.

No comments: