How to Import and Export a Database with phpMyAdmin

phpMyAdmin lets you save a copy of a database to your computer or load a database from a file, which is how you move a site between hosts or take a quick backup before a risky change. This guide shows how to import and export a database with phpMyAdmin in your Instant Access Internet Services cPanel, and how to fix the most common import errors.

How to open phpMyAdmin

  1. Log in to cPanel and go to Databases > phpMyAdmin. It opens in a new browser tab and logs you in automatically.
  2. In the left-hand panel, click the name of the database you want to work with. Database names start with your cPanel username and an underscore, for example username_wp123.

Not sure which database your WordPress site uses? Look at the DB_NAME line in wp-config.php (right-click it in File Manager and choose View).

How to export a database with phpMyAdmin

  1. Select the database in the left-hand panel, so its name shows at the top of the page.
  2. Click the Export tab at the top.
  3. Leave Export method set to Quick and Format set to SQL.
  4. Click Export. Your browser downloads a file named after the database, ending in .sql.

For a large database, choose Custom instead, scroll to Output and set Compression to gzipped. The download is much smaller and can be imported directly.

Remember that an export only contains the database. A complete website backup also needs your files. Your account is also backed up automatically with JetBackup 5, which you can use to download or restore a database (see the related guides).

How to import a database with phpMyAdmin

Importing adds the tables in your file to the selected database. If a table of the same name already exists and the file doesn't drop it first, the import stops with an error, so it's best to import into a new, empty database.

  1. Create an empty database (and a user for it) in Databases > Manage My Databases if you don't already have one. See the related guide below.
  2. In phpMyAdmin, click that database in the left-hand panel.
  3. Click the Import tab.
  4. Under File to import, click Browse (or Choose File) and pick your .sql file. Compressed .sql.gz and .zip files work too. The maximum file size is 50 MB.
  5. Leave the other options at their defaults and click Import at the bottom of the page.
  6. Wait for the green success message. The new tables appear in the left-hand panel.

To replace an existing database completely, export it first as a safety copy, then open its Structure tab, tick Check all, choose Drop from the menu and confirm, and import your file into the now-empty database.

Troubleshooting

The file is too big to import

phpMyAdmin accepts files up to 50 MB (the Import tab shows the limit next to the file button). If your file is larger:

  • Compress it as .sql.gz or .zip first; SQL files usually shrink by 80-90%.
  • If you have shell access, upload the file with File Manager and import it from Terminal: mysql -u username_dbuser -p username_dbname < backup.sql
  • Otherwise, upload the file to your account and open a ticket, and we'll import it for you.

"#1044 - Access denied for user ... to database"

The file contains a CREATE DATABASE or USE line with a different database name (common when moving from another host). Open the file in a text editor, delete those lines near the top, and import again into the database you selected.

"#1050 - Table already exists"

The database isn't empty. Import into a new database, or drop the existing tables first as described above.

"#1227 - Access denied; you need (at least one of) the SUPER privilege"

The file contains DEFINER= statements from another server. Remove the DEFINER=`user`@`host` parts with a text editor, or re-export the original with them turned off, and try again.

The import timed out or stopped part way

Try a compressed file, or drop the partly imported tables and try again. For very large databases, use the Terminal method or ask us to import it.

My WordPress site shows the old site address after importing

The site URL is stored in the database. If you moved a site to a new domain, the addresses inside the database need updating too. WP Toolkit's import tool handles this for you when moving a WordPress site from another host.

Related guides

Still stuck? Open a support ticket and the Instant Access Internet Services team will help.

Ultrafast LiteSpeed hosting from InstantAccess.net: free SSL, free backups, cPanel included, no contracts. Check out our $10/month hosting.
  • phpmyadmin import database, phpmyadmin export database, import sql file cpanel, export mysql database cpanel, backup database phpmyadmin, phpmyadmin upload limit
  • 0 Пользователи нашли это полезным
Помог ли вам данный ответ?

Связанные статьи

How to Change a MySQL Database User's Password

You might need to change a database password after a security scare, when a developer leaves, or...

How to Create a MySQL Database and User in cPanel

Most website software, including WordPress, Joomla and online shops, stores its content in a...

How to Open phpMyAdmin from cPanel and Find Your Way Around

phpMyAdmin is a web page for looking inside your MySQL databases: you can see the tables your...

How to Move a MySQL Database from Another Host to Your Account

Moving a website to us usually means moving two things: the files and the MySQL database behind...

How to Import a Database That's Too Big for phpMyAdmin (Using SSH)

phpMyAdmin on your hosting account accepts import files up to 50 MB, and even smaller files can...