How to Duplicate and Manage MySQL Databases in cPanel
**Description:**This guide provides a step-by-step process for duplicating (copying) and managing MySQL databases in cPanel. It’s designed for Brixly shared hosting customers who want to create safe database copies for development, testing, or backup purposes—using only tools available within your cPanel account.
Table of Contents
Introduction
Duplicating a MySQL database is a common task for website owners who want to:
-
Set up a development or staging environment
-
Test new features or plugins safely
-
Create manual backups
You don’t need server admin access—everything can be done using cPanel and its built-in tools.
Before You Start
Requirements:
-
Access to your hosting account’s cPanel
-
Sufficient disk space for the database copy
-
Your cPanel MySQL username and password
Tip: If your database is large (over 100MB), consider exporting/importing in smaller chunks or contact support for advice.
Step 1: Export the Original Database via phpMyAdmin
-
Log in to cPanel.
-
Go to the Databases section and click phpMyAdmin.
-
In the left sidebar, select the database you wish to duplicate.
-
Click the Export tab at the top.
-
Choose the Quick export method and SQL format.
-
Click Go.This will download a
.sql
file to your computer.
*Example:*If your database is called cpaneluser_live
, you will download something like cpaneluser_live.sql
.
Step 2: Create a New (Empty) Database in cPanel
-
Return to the main cPanel dashboard.
-
Under the Databases section, select MySQL Databases.
-
Under Create New Database, enter a name (e.g.,
cpaneluser_dev
) and click Create Database. -
Scroll down to MySQL Users and either:
-
Create a new user (recommended for testing/dev)
-
Or, use your existing MySQL user
-
-
Assign the user to the new database:
-
In Add User to Database, select the user and database, then click Add.
-
On the next screen, select ALL PRIVILEGES and click Make Changes.
-
Step 3: Import the SQL File into the New Database
-
Go back to phpMyAdmin via cPanel.
-
In the left sidebar, click on your new (empty) database.
-
Click the Import tab at the top.
-
Click Choose File and select the
.sql
file you exported earlier. -
Leave all settings as default and click Go.
If the import is successful, you’ll see a confirmation message.
Step 4: Update Application Configuration (If Needed)
If you want your website or application to use the duplicated database (e.g., for a development site):
-
Edit your app’s configuration file (commonly
wp-config.php
for WordPress,.env
for Laravel, orconfig.php
). -
Update the database name, user, and password to match the new database.
Example for WordPress (wp-config.php
):
define('DB_NAME', 'cpaneluser_dev');
define('DB_USER', 'cpaneluser_newuser');
define('DB_PASSWORD', 'your_new_password');
define('DB_HOST', 'localhost');
Managing MySQL Databases in cPanel
-
**Check/Repair Databases:**In MySQL Databases, use the Check Database and Repair Database tools if you suspect data corruption.
-
**Delete Unused Databases:**Remove test databases you no longer need to free up space.
-
**Manage User Privileges:**Always assign only the required privileges to users for better security.
Troubleshooting & Common Issues
Import Fails Due to Size or Timeout
-
Try splitting the
.sql
file if it’s very large. -
Use a faster internet connection or different browser.
-
If you see repeated failures, consider contacting support for assistance.
Access Denied or Privilege Errors
-
Double-check the user is assigned to the new database with all privileges.
-
Re-enter the password in your app’s config file.
“Unknown Database” or “Table Not Found” Errors
-
Ensure you imported into the correct, empty database.
-
Verify the configuration file matches the new database and user details exactly.
Summary
Duplicating a MySQL database in cPanel is a straightforward process:
-
Export your current database with phpMyAdmin
-
Create a new database via cPanel
-
Import the SQL file into the new database
-
Update any application configuration files as needed
Using cPanel’s built-in tools ensures your data stays secure and you remain in control—no server admin access required. If you need further help, our support team is here to assist!
*For more guides and support, visit the *Brixly Knowledge Base.