PHPMyAdmin: MySQL backups with PHPMyAdmin

Location: Articles > Databases > MySQL > PHPMyAdmin > Here
Written By: Site Admin
Date: 5 Jun 2005
Level: 2 (Novice)

Table of Contents

  1. PHPMyAdmin MySQL Backup
  2. Restoring the backup
  3. Troubleshooting

phpMyAdmin has an export feature that allows you to save the structure and data of the information in a SQL file, which is a text file that contains commands. This file can be executed (this can be done in phpMyAdmin) and it will restore the data and database structure.

Part 1: PHPMyAdmin MySQL Backup


Figure 1.1 The Export page in phpMyAdmin

Firstly, start phpMyAdmin. There should be a link to it in your web hosting control panel if provided.

The first step is to simply select Export from the phpMyAdmin home page. This will lead to the export database page - see the image above, note that the Export page will appear different depending on the version of phpMyAdmin you are using however the functionality is usually the same.

To begin with, select the databases you want to backup and choose the SQL option (should be default and already selected). Then make sure that both the boxes for Structure and Data are checked and that should be it. Select Go and you will be taken to a page with a text box with text starting with phpMyAdmin SQL Dump or similar.

That text file containing the SQL commands is the file you need. If you want it saved, copy the text into Notepad or another text editor and save it. The export page has a "Save as file" option to make the task of saving it quicker.

Part 2: Restoring the backup

This is the simple part however it is also the most troublesome. Especially in cases when you are switching servers, you may get errors when you try to restore your backup such as incompatible table attributes.

To restore the MySQL backup, go into phpMyAdmin and select SQL, the tab for this is on the top of most pages. If it is not there, select a database and it will appear. Note that the database you are in is irrelevant for SQL execution. In the SQL page, you have 2 options, to copy the text from the text file containing the SQL code that you created and enter this into the textbox or to specify the file in the "Location of the text file:" option.

Hopefully, there will be no problem and the SQL will be executed without error, however, if problems occur, refer to the Troubleshooting section below.

Part 3: Troubleshooting

[article writing in progress]