Docs Home Return to Homepage
Get Started Login

How to Import and Export a Database with phpMyAdmin in cPanel

Last updated Changelog

On this page

phpMyAdmin is a tool for working with your MySQL databases in the browser. The two jobs people use it for most are importing a database (for example when moving a site to NameCrane) and exporting one (to take a copy or move it elsewhere). Both are a few clicks.

Warning: Importing adds to, or replaces, what’s in the database you choose. Make sure you’ve picked the right one, and export a copy first if it already has data you care about.

Before you start

Import a database

  1. Log in to cPanel. In the Databases section, click phpMyAdmin. It opens in a new tab, already logged in.

    The cPanel Databases section with phpMyAdmin highlighted

  2. In the list on the left, click the database you want to import into.

    phpMyAdmin with the cranedemo_shop database highlighted in the left-hand list

  3. Click the Import tab.

    The database page with the Import tab highlighted

  4. Under File to import, click Choose File and pick your .sql file. Compressed files (.sql.gz, .sql.zip) work too. The maximum size is shown next to it.

    The Import page with Choose File and the selected crane-demo-products.sql highlighted

  5. Leave the other options as they are, scroll down and click Import.

    The Import button highlighted at the bottom of the page

  6. phpMyAdmin shows Import has been successfully finished, with the number of queries it ran.

    The success message “Import has been successfully finished, 2 queries executed”

  7. Your tables now appear under the database on the left. Click one to see its contents.

    The imported products table showing three rows

Export a database

  1. Click the database in the left-hand list, then click the Export tab.

    The database page with the Export tab highlighted

  2. Leave Quick selected and the format as SQL, then click Export. Your browser downloads a .sql file named after the database.

    The Export page with Quick, SQL and the Export button highlighted

Tip: An exported database contains everything in it, including user accounts and email addresses for a WordPress site. Store it somewhere safe and don’t email it around.

Troubleshooting

Problem What to do
The file is too big to import Compress it to .sql.gz first, which often makes it ten times smaller. If it’s still too big, contact support for help.
“#1044 - Access denied” or “CREATE DATABASE” errors Your file tries to create its own database. Remove the CREATE DATABASE and USE lines from the top of the file, or ask whoever made the export to export just the tables.
“#1050 - Table already exists” The database isn’t empty. Import into a new, empty database, or drop the existing tables first if you’re sure you don’t need them.
My site shows the old content after importing Check your site’s settings (for WordPress, wp-config.php) point at the database you imported into.

Snagged on something? Contact support and we’ll get you sorted.

Snagged on something?

Our sysadmins answer tickets around the clock.