MySQL: Backup and Restore Database using mysqldump

In this post, I am providing a script to perform Backup and Restore of MySQL Database using Mysqldump.

Mysqldump is an important tool of MySQL Server and it creates a *.sql file with database structure and data. It also includes all possible table lock and object existence script.

I am sharing different syntax and script to perform Backup and Restore of single database or multiple database.

Syntax and Command to take backup of Single Database:
You can execute this using MySQL Command line.

Syntax and Command to execute restore of Single Database:
New blank database require to create before any restore operation.

Command to take backup of multiple databases:

Command to take backup of all databases:

Anvesh Patel

Leave a Reply

2 Comments on "MySQL: Backup and Restore Database using mysqldump"

Notify of
avatar
Sort by:   newest | oldest | most voted
Harikrishna Guggilla
Guest
To take Backup using mysqldump is right but for restoring is not fair using mysqldump So i think we have to go with Backup: mysqldump -u root -p –single_transaction –routines > “path.sql” Restore: To restore the data mysqldump is not fair for restore. mysql -u root -p We have another way to to take Backup and restore using utilities. Utilities is better than mysqldump . It is much faster than mysqldump syntax: step 1; select * into outfile ‘D:\mysql\backup\sakila.csv’ fileds terminated by ‘,’ enclosed by ‘”‘ lines terminated by ‘\r\n’ from sakila; step2 : create table sakila_tmp like sakila; step… Read more »
wpDiscuz