How to export and import a database with phpMyAdmin in cPanel

Category: cPanel

phpMyAdmin is the tool included in cPanel that lets you manage your MySQL databases from the browser. In this guide you will learn how to export a full database to an .sql file and how to import that file into another database, whether you need a backup before a major change, a site migration, or a data restore.

Before you start

  • You need access to your cPanel account. If you don’t remember how to log in, check the service welcome email for your credentials.
  • Identify the exact name of the database you want to export. You can find it in the Databases section of cPanel.
  • If you plan to import into a new database, create it first using Database Wizard in cPanel and assign a user with all privileges.
  • phpMyAdmin on shared hosting plans has a server-defined file-size limit for imports. If your file is larger than the limit shown in the interface, contact support so they can help you.

Export a database

  1. Log in to cPanel and find the Databases section.
  2. Click phpMyAdmin. It will open in the same tab or a new tab, depending on your browser.

Find phpMyAdmin in the Databases section of cPanel

  1. In the left panel of phpMyAdmin, click the exact name of the database you want to export.

Select the database in phpMyAdmin

  1. Click the Export tab at the top.
  2. Leave the method set to Quick - display only the minimal options and the format set to SQL. This exports all tables with their structure and data.
  3. Click the Export button.

Confirm Quick and use Export in phpMyAdmin

  1. Your browser will download an .sql file to your computer. Save it in a safe place; that file is your backup.

Import an SQL file

  1. Log in to cPanel and open phpMyAdmin from the Databases section.
  2. In the left panel, click the destination database where you want to import the data.
  3. Click the Import tab at the top.
  4. In File to import, use the file selector beside Browse your computer and select the .sql file you downloaded earlier.
  5. Leave Format set to SQL. Under Character set of the file, leave the value unchanged; if you need to set one manually, use utf-8.
  6. Click the Import button.
  7. Wait for the process to finish. phpMyAdmin should display Import has been successfully finished.

Confirm that the SQL import completed successfully

How to verify it worked

  1. In phpMyAdmin, click the destination database in the left panel and confirm that all the tables you expected are listed.
  2. Click an important table (for example, a posts table if you use a CMS) and check that the records are complete.
  3. Open your website in the browser and navigate through several pages to confirm it loads correctly.
  4. If your site runs a CMS, log in to the admin dashboard and verify that posts, pages, and settings are intact.

Common errors

  • “You do not have permission to access this database” → The assigned MySQL account does not have privileges on that database → Go to MySQL Databases in cPanel, find the database, and assign the account with all privileges.
  • “Max file size exceeded” or the file won’t upload → The .sql file exceeds phpMyAdmin’s import limit → Contact support so they can import the file for you.
  • "#1062 – Duplicate entry" → The destination database already had tables with data and there are conflicts → Before importing, go to the Structure tab, select all tables, and choose Drop to empty the database, then repeat the import.

When to ask for help

If your backup file is larger than what phpMyAdmin allows you to upload, if you get errors that the steps above don’t resolve, or if you need to migrate several databases at once, open a support ticket from your client area. The support team can import large files and review permissions directly on the server.

Still need help?

If this guide didn’t solve your issue, our team can help you via ticket.