cPanel & Hosting How-Tos How to Import and Export a MySQL Database with phpMyAdmin
Exporting and importing databases is how you back up, move and restore the data behind your site. phpMyAdmin in cPanel handles it through a simple interface. Here’s how, including how to get past the size and timeout limits on bigger databases.
Export a database (backup or move)
- In cPanel, open phpMyAdmin.
- Select your database from the list on the left (check
wp-config.phpfor the name if unsure). - Click the Export tab.
- Choose Quick export and the SQL format.
- Click Go — a
.sqlfile downloads to your computer.
That .sql file is a complete copy of the database. Keep it as a backup, or use it to move the site.
Import a database
- In phpMyAdmin, select the target database (ideally an empty one you’ve created in cPanel).
- Click the Import tab.
- Choose File and select your
.sqlfile. - Leave the format as SQL and click Go.
When it finishes, the tables and data are in place. For a moved site, update the app’s config (for WordPress, wp-config.php) to point at the new database.
Importing can overwrite tables that already exist. Import into an empty database, or back up first.
Handling large databases
phpMyAdmin limits how big a file you can upload in the browser. If your import is too large:
- Compress it. Zip or gzip the
.sqlfile and import the.zip/.gzdirectly — phpMyAdmin accepts compressed imports, and smaller files upload within the limit. - Raise PHP limits. Increase
upload_max_filesize,post_max_sizeandmax_execution_time— see increase PHP limits. - Use the command line. With SSH enabled, import with no browser-size limit:
mysql -u DBUSER -p DBNAME < backup.sql
Repair or optimize while you’re there
phpMyAdmin can also repair a corrupted table or optimize tables to reclaim space: select the tables, then choose Repair table or Optimize table from the “With selected” dropdown. This can fix a database that’s throwing errors.
Part of every migration
Importing and exporting databases is a core step when you migrate a website or recover one. Every Web Hosting and WordPress Hosting plan includes phpMyAdmin on fast NVMe storage, and our support team can help with a large or stubborn database import.
Frequently asked questions
How do I export a database in phpMyAdmin?
Open phpMyAdmin in cPanel, select the database on the left, click the Export tab, choose the Quick method and SQL format, and click Go. You get a .sql file containing the whole database, ideal for a backup or a move.
My database is too large to import in phpMyAdmin. What do I do?
phpMyAdmin has an upload size limit. Compress the .sql file to .zip or .gz and import that, raise the PHP upload and execution limits, or for very large databases import from the command line with SSH, which has no browser-size limit.
Will importing a database overwrite the existing one?
An import adds or replaces the tables in the .sql file. If you import into a database that already has those tables, it can overwrite their data. Import into an empty database, or back up first, to avoid losing anything.