mysqldump

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

Posted in MySQL