Creating a backup is very important and common task In this article, I will outline how to back up and restore database in MySQL.
A Simple Database Backup:
You can use mysqldump to create a backup. Here is general syntax to do that
mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]Restore using mysql
If you want to restore mysqldump file you can use mysql command. Here is general structure of mysql command:
mysql -u [username] -p [password] [database_to_restore] < [backupfile]
Note: Use common command prompt for these commands instead of MySQL shell.
Comments
Post a Comment