Quick backup and restore of mysql

Dear friends,
please let me know how to restore mysql data to database server quickly as I have 2.1 GB of database dump its taking very long time to revert to the database server. Please let me know is there any quick option to do this. I am using CentOS 6.5 and mysql 5 versions.

Hi did you try this…

# mysql -u root -p[root_password] [database_name] < dumpfilename.sql 
1 Like

Hi Raghu

Yes I tried it but taking much time…

Hi,

Raghu has provided the right command, I have no idea apart from this.
If you have large amount of data files, you can use lvm snapshot rather than taking backup of mysql, if you need fast.

Hey

You need to use following syntax:

mysql -uroot -ppassword database < dump.sql

But while your dump is 2 Gb it will take a while to complete anyway.
You can try to use PHPMyAdmin for that but most likely will not have a benefit of time.

You also may need to disable all other connections to the database during restore so you can be sure that there will be no deadlocks.

Take a look here for more information about MySQL backup and restore, it may help you.