(gs):Copy your database using phpMyAdmin

  • This page was last modified on March 29, 2012, at 08:30.
The (mt) Community Wiki is a collaborative project. Any (mt) Media Temple customer or employee may contribute. Not all articles and/or content have been tested for accuracy by (mt) Media Temple.

For officially moderated and tested articles, be sure to visit our KnowledgeBase.

From (mt) Community Wiki

Contents

Overview

In this article, we will explain on how to quickly copy a database using phpMyAdmin. This may save you some time when trying to replicate your database if you are used to exporting and importing SQL files all day.

Requirements

First things first. You will need to have both database on the same (gs) Grid-Service in order for phpMyAdmin to use its copy function.

In order to copy one database to another using phpMyAdmin, you will need to log in with a database user that has permission to read and write both databases. In this example, we will be using the database administrator user. The database administrator user is the user which only contains the db12345 without the _username after it. This is the first user that you set up when you access Manage Databases within your (gs) Grid-Service Control Panel for the first time.

If you are using a different user other than the database administrator, make sure that you set Read/Write permissions for both of the databases. This is covered within the following article: Database users on the (gs) Grid-Service.

Create a database

In order to copy from one database to another, you will need the new database to exist (duh!). You can refer to this article for information about how to create a new database: How do I create a database?

Log into phpMyAdmin

To copy the original database to the new database you will first need to log into phpMyAdmin. This article will explain on how to access phpMyAdmin: Managing a MySQL database with phpMyAdmin.

Copy the database

Once you are logged in, you will want to follow these steps to copy the database to the other:

  1. Select your original database.
  2. Select the Operations tab above your list of tables.
  3. Enter the new database name within the field below "Copy database to:".
  4. Uncheck the "CREATE DATABASE before copying" checkbox.
  5. Select the Go button.

You are finished! You should be able to compare the same number of tables exist within the new database as they do within the original database.