Skip to main content
You can import and export MySQL databases through phpMyAdmin in cPanel. This is useful when migrating a site, restoring a backup, or moving data between environments.

Import a database

1

Open phpMyAdmin

Log in to cPanel through your client area or at yourdomain.com/cpanel. Go to Databases and click phpMyAdmin.
2

Select the target database

Click the database you want to import into from the left sidebar. If you haven’t created one yet, go back to cPanel and use MySQL Databases to create it first.
3

Import the file

Click the Import tab at the top, then click Browse to select your .sql file. Leave the default settings and click Go.
You’ll see a success message once the import finishes.
phpMyAdmin has a file size limit for imports. For larger databases, import via SSH instead:
mysql -u dbuser -p dbname < backup.sql

Export a database

1

Open phpMyAdmin

In cPanel, go to Databases and click phpMyAdmin.
2

Select the database

Click the database you want to export from the left sidebar.
3

Export

Click the Export tab. For most cases, the Quick method with SQL format works fine. Click Go to download the .sql file.
Use the Custom export method if you need to export specific tables or adjust options like adding DROP TABLE statements.

Fix “Access denied CREATE DATABASE” errors

This error happens when your .sql file contains a CREATE DATABASE statement. On shared hosting, your cPanel user doesn’t have permission to create databases through SQL — you create them through cPanel instead. To fix it:
  1. Open the .sql file in a text editor.
  2. Find and delete the CREATE DATABASE line (usually near the top). Also remove any USE database_name; line if present.
  3. Save the file and import it again, making sure you’ve selected the correct database in phpMyAdmin first.