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:

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from

Leave a Reply

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

Notify of
Sort by:   newest | oldest | most voted
Harikrishna Guggilla
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 »