How to Backup and Restore MySQL Database?

If you’re storing anything in MySQL databases that you do not want to lose, it is very important to make regular backups of your data to protect it from loss. This tutorial will show you easy ways to perform MySQL backup and restore the data in your MySQL database. You can also use this process to move your data to a new web server.
 

Basically, many ways for you to backup the database which are via phpMyAdmin, through control panel and many more. For example, if through phpMyAdmin, you may do so by login to phpMyAdmin and click Export from there. 

However, if the database size is quite big, then this is the easiest way to perform the backup and restoration.

How to perform MySQL backup?

Backup Database 
mysqldump -u root -p databasename > databasename.sql
* Please make sure this command running in the location that have mysqldump for Windows server
For windows, you need to enter the following path for example:- 
cd /path/to/dir/ 

How to perform MySQL restore?
Restore Database 
mysql -u root -p databasename < databasename.sql


Comments