Create a copy of MySQL Database using phpMyAdmin

Sometimes it requires to quickly create a clone of the MySQL database while working on the project either for the backup purpose, using it on a copy of the project, or moving the project.

With phpMyAdmin, this process is easier.

In this tutorial, I am assuming that you already have a cPanel enabled web hosting server.

Create a copy of MySQL Database using phpMyAdmin


Contents

  1. Directly from phpMyAdmin
  2. Export and Import
  3. Conclusion

1. Directly from phpMyAdmin

  • Login to your cPanel and open phpMyAdmin.

Open phpMyAdmin from cPanel

  • Select the database in which you want to create a copy.
  • Click on the Operations.
  • Now enter the new database name in Copy database to section and set the radio button to Structure and data.

Go to Operations from phpMyAdmin

  • Click on the Go button.
  • A new database is been created.

New database is created after copying


2. Export and Import

There are the following steps –

Export Database

  • Open phpMyAdmin.
  • Select your Database which you want to create a clone.
  • Click on the Export and select the format to SQL and click on the Go button.

  • Now need to create a new MySQL database for data import.

Create Database

  • Navigate to your cPanel home and click on MySQL databases under Databases.

Open MySQL Databases from cPanel

  • Enter the name of the database and click on the Create Database button.

Enter new database name

Create a User

  • Navigate to Add New User Section.
  • Enter the username and password and click on the Create User button.

Create a new user for MySQL database

Assign the user to the database

  • Navigate to Add User To Database.
  • Here, select your created user and Database from the drop-down.

Assign a user to a MySQL database

 

  • Click on the Add button.
  • You will be taken to the Manage User Privilege section. Here, check the All Privileges checkbox and click on Make Changes button.

Assign permissions to MySQL database user

Import SQL file

  • Open phpMyAdmin and select the newly created database.
  • Click on the Import.
  • Choose the exported SQL file and click on the Go button.

Import SQL file from phpMyAdmin

  • You will see a success message after successfully importing.

3. Conclusion

Follow any of the above methods to create a duplicate of the selected MySQL database either on the server or local system.

If you found this tutorial helpful then don't forget to share.

Leave a Comment