Are 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.
We’ll assume that you’ve already exported your database, and it is either a .sql, zip, or tar.gz file.
You should have already created the new database that you’re importing into as well.
Log into cPanel
- Under Databases, open phpMyAdmin by clicking the phpMyAdmin icon
- On the left, select the database that you will be working with
- Click Import in the top menu
- 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)
- Click Go at the bottom right to import the database file
- 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.
Congratulations, you have just imported a database!
#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.
CREATE SCHEMA IF NOT EXISTS `DataBaseName` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; MySQL said: Documentation #1044 – Access denied for user ‘userna5’@’localhost’ to database ‘DatabaseName’
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. You can use our MySQL – 1044 Access Denied Error Message tutorial and a text editor such as Notepad++ or Atom.io to accomplish this.
50+ MB databases
The process for uploading databases over 50 MB differs depending on your InMotion Hosting plan.
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.
Note: If you need assistance with importing the process, you can email our technical support a verified ticket request with the file and database name.
We also have articles to help you manage your databases and troubleshoot errors – e.g. MySQL Error 1064: You have an error in your SQL syntax . If you have any issues upon importing your database, trying running a check and repair using cPanel or phpMyAdmin.