HomeMySQL Page 5 - Backing Up and Restoring Your MySQL Database
Backing Up and Restoring Your Database with PHPMyAdmin - MySQL
Do you need to change your web host or switch your database server? This is probably the only time when you really think of backing up your MySQL data. If you've got a website with a database or your custom database running for your applications, it is imperative that you make regular backups of the database. In this article, I will outline two easy ways of backing up and restoring databases in MySQL.
You can backup your database using PHPMyAdmin in just a few mouse clicks. First head over to your database by clicking the database name in the list on the left of the screen. Once you get to your database details, you should get a menu header for your database which looks like so:
Click on Export. This will get you to a screen with the following options.
From here it's just a matter of clicking the right options and the 'Go' Button to get your database dump. To save the backup file on your computer, click on the Save as file option and the corresponding compression option to get the backup to download to your system.
Restoring your Database via PHPMyAdmin
Restoring your database is as easy as backing it up. If you would like to rewrite the backup over an existing database, click on the database name in the database list on the left, click all the check boxes next to the table names and select Drop in the With selected: drop down box.
This will drop all existing table in the database. Then head over to the top menu bar and click on SQL. This will bring up a window where you can either type in SQL commands, or upload your SQL file. The window should look like this:
Click on the Browse button, and select the sql backup file you wish to upload to the server. Once you've selected the file, click on 'Go'. This will upload the backup file to the server and execute the SQL commands in the backup and restore your database.
Now that you know how easy it is to backup and restore your database, spend a few minutes everyday to backup your important data. You can even automate the backup process by using a task scheduler like cron.