HostOnNet Blog

mysqldump

Looking for Linux Server Admin or WordPress Expert? We can help.

mysqldump command is used to take MySQL backup.

Take Backup of All databases

To take backup of all Databases on a MySQL server, run

mysqldump --all-databases > mysql_all_dbs.sql

Take Backup of a MySQL Database

To take Backup of a MySQL Database, run

mysqldump DB-NAME-HERE > DB-NAME-HERE.sql

Restoring Backup Taken with mysqldump

mysql DB-NAME-HERE < MYSQLDUMP_BACKUP_FILE.sql

Forcing mysqldump

You can use –force option to force mysqldump backup that will ignore sql errors, by default backup fail if there is error in dumping a table.

mysqldump --force DB-NAME > DB-NAME.sql

Posted in MySQL

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.