Ask a Question

Knowledge Base

Tools
Categories Rss

Exporting and importing a MySQL database

Reference Number: AA-00168 Views: 1395 Created: 2010-07-30 15:10 Last Updated: 2010-12-17 11:17 0 Rating/ 0 Voters

If you wish to move your MySQL database from one server to another, you can export and then import the tables and contents of your database using phpMyAdmin.

Is your database large?

If you have a very large database sometimes the backup process can time out or fail within phpMyAdmin. The work around to this is to use a simple PHP script, uploaded to your home directory to run a mysqldump command. If you use the process below and the backup times out, here's how to perform a backup using PHP: How to perform a MySQL dump with PHP

Exporting a MySQL Database

  1. Firstly, manage your database with phpMyAdmin by logging into Plesk and clicking on the Databases icon. Click on your database, and then the DB WebAdmin icon.
  2. Once phpMyAdmin has loaded (if it hasn't, check to make sure you allow pop-ups) click on your database in the left column.


  3. Click on the Export tab


  4. Select the tables that you wish to export. In the example below, we have selected all tables, table1, table2 and table3.


  5. Scroll to the bottom of the page, and select Save as file and click Go


  6. Save the resulting SQL dump file to a location on your computer.

Importing a MySQL Database

  1. Firstly, make sure you have created your new database in Plesk. Then manage your new database with phpMyAdmin by logging into Plesk and clicking on the Databases icon. Click on your database, and then the DB WebAdmin icon.
  2. Once phpMyAdmin has loaded (if it hasn't, check to make sure you allow pop-ups) click on your database in the left column.


  3. Click on the Import tab


  4. Browse to your saved SQL dump file, and click Go to import tables and content to the new database.


Info Ask a Question