CpanelLinux

How to Import a MySQL Database using phpMyAdmin

Importing a MySQL database using phpMyAdmin is a straightforward process that allows you to transfer data from one database to another or restore a backup. If you planning to share a locally developed database from your web server? Maybe you’re migrating a database for WordPress or another content management system (CMS) for development purposes. Whatever the case, phpMyAdmin has a simple process for importing a database file after creating the database in cPanel.

In this tutorial, we will show you how to import a MySQL Database using phpMyAdmin in cPanel.

Import MySQL Database

Importing a database via phpMyAdmin involves a few simple steps. Here’s a detailed guide:

  1. Log into cPanel.
  2. Under Databases, open phpMyAdmin by clicking the phpMyAdmin icon.
  3. On the left, select the database that you will be working with.
  4. Click Import in the top menu.
  5. Under File to Import, click Browse and select the backup file you previously created (it will either be a .sql .zip or .tar.gz file).
  6. Click Go at the bottom right to import the database file.
  7. When the database has been imported successfully, you should see a message at the top of the page similar to: Import has been successfully finished, ## queries executed.

That’s it! You’ve successfully imported a MySQL database using phpMyAdmin. If you encounter any issues during the process, double-check your settings and consult any error messages for troubleshooting assistance.

Troubleshooting

#1044 – Access denied

If you get the following error when importing a database via PhpMyAdmin, you will need to edit the SQL file you’re trying to import. PhpMyAdmin does not allow you to CREATE databases due to security reasons. In order to get your SQL file to load you will need to remove the CREATE SCHEMA line at the beginning of your code.

50+ MB databases

The process for uploading databases over 50 MB differs depending on your Hosting plan.

Shared Servers

For databases over 50 MB, you can simply import the database via SSH. Alternatively, you can install a phpMyAdmin instance to import it to your server.

VPS / Dedicated Servers

VPS and Dedicated server users with root access can increase the max upload size as needed in WebHost Manager (WHM) Tweak Settings section.

Advanced users with root access can import a database larger than 50 MB by logging into MySQL in SSH.