Backup and Restore Mysql Databases
Backup and Restore Mysql Databases
XAMPP includes phpMyAdmin, an open-source, browser-based tool for managing MySQL database servers.
This guide walks you through the process of backing up and restoring a MySQL database using phpMyAdmin.
This guide assumes that you already have a PHP application that uses a MySQL database deployed on
XAMPP. The example application used in this guide is WordPress, although the steps outlined below will work
for any application.
Remember that you can install WordPress quickly using the Bitnami WordPress module for
TIP
XAMPP.
2. Select the database to be backed up from the list in the left navigation pane. In this case, we’re backing up
the WordPress database, which is named bitnami_wordpress.
4. On the resulting page, select "Quick" as the export method and "SQL" as the output format. Click "Go" to
proceed.
1
phpMyAdmin will export the database to a text file as a series of SQL statements. Once done, the browser will
prompt you to download it to the desktop. This text file is your backup, so store it safely!
At a later point, you may wish to restore the database. To restore the data to a fresh MySQL database using
phpMyAdmin, follow these steps:
3. On the resulting page, enter a name for the new database (in this case, myblog). Select the collation
"utf8_general_ci". Click "Create" to create the database.
2
Once the database has been created, it will appear in the left navigation pane.
4. Select the new database from the left navigation pane. In the resulting page, select the "Import" command
in the top navigation bar.
5. Click the "Browse…_" button and select the backup file created earlier. Click "Go" to proceed.
phpMyAdmin will import the data from the backup file. Once complete, you will see a screen indicating the
status of the import.
3
If you browse the contents of the database, you should now see your original data.
You should now update your application’s configuration and point it to your newly-created database. For
example, with the Bitnami WordPress module, you will need to edit the wp-config.php file in the
apps\wordpress\htdocs\ subdirectory of your XAMPP installation directory. Within this file, you will need to
update the DB_NAME constant to use the new database name.