Backup MySQL Database - Learn How to Export Your MySQL Database

In this article, I'll show you how to backup your MySQL database. This is also commonly referred to as exporting your MySQL database, and the process is fairly simple.

How to Backup Your MySQL Database

Step 1 - Open phpMyAdmin

If you're unfamilar with phpMyAdmin, it's used to manage your MySQL database. Look for the phpMyAdmin icon in the control panel of your current web host.

The picture below shows what the database area looks like in the popular cPanel control panel at HostGator (if you're looking for a reliable web hosting company, they're one of the best).


Step 2 - Click Export

After you have opened  phpMyAdmin, you will see in the top bar (like pictured below) the Export tab. Click this tab to open the export page.

Backup MySQL Database

Step 3 - Choose the custom export method

Now that you are on the export page, you will be asked if you want to make a quick export or a custom export. Click custom because you will need to change a few things.

Custom Install

Step 4 - Select the database you want to backup

Next you will need to select the database you wish to export. In the picture below, I have selected "Test Website". You don't need to backup any of the default databases like information_schema, mysql, or performance_schema.

Select Database

Step 5 - Select Add DROP DATABASE and structure and data

Make sure the Add DROP DATABASE statement and the structure and data option are selected as shown at the bottom of this picture below. This is used to make it easier to restore your database with the backup you're making. If you don't select these options, you'll have to delete the old database before restoring from your backup. Also make sure to save the file as the .SQL option.

Add Drop Database

Step 6 - Click GO to export your MySQL database

All that is left to do to backup your MySQL database is to scroll to the bottom of the page and click the GO button. Make sure to save the .SQL (in this case TestWebsite.SQL) somewhere you can find it later on. This file that you have created is a backup that you can keep just in case problems arise.

Export MySQL Database