How to create MySQL dumps?

As you have to move a MySQL database from one server to another you might run into troubles. Tools like phpMyAdmin may help you on creating backups of your existing databases but the tool of choice is mysqldump which usually comes with every MySQL package.

mysqldump -uUSERNAME -pPASSWORD DATABASE TABLE > FILENAME

(just replace the collation letters with your data)


Since you might encounter different MySQL version on the target/source system there are compatibility switches in newer releases of mysqldump, most importently:

--compatible=mysql3

(creates a dump which is compatible with MySQL 3.1.xx)


--compatible=mysql40

(creates a dump which is compatible with MySQL 4.0.xx)

You cannot comment on this entry