Import a MySQL Database using phpMyAdmin
In this tutorial:
In this tutorial, we will show you how to import a MySQL Database using phpMyAdmin.
- Log into cPanel
- Open phpMyAdmin by clicking the phpMyAdmin icon
- Select the database in the left menu 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 be either a .sql .zip or .tar.gz file).
- Click Go at the bottom right
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 a database through 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, this tutorial here can help
50+ MB databases
If the database that you are trying to import is over 50 MB in size, then you will not be able to import the database through phpMyAdmin on shared servers.
VPS and Dedicated Servers
Only VPS/Dedicated server accounts with root access can import a database larger than 50 MB using the command line access. For more details on the actual command, go to mysqlimport - a data import program.
For users on shared hosting, you can follow these steps to import a database larger than 50MB.
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!
2014-09-11 2:29 am
find this error
You probably tried to upload a file that is too large. Please refer to documentation for a workaround for this limit.
2014-09-11 6:39 am
50MB is the size limit for database imports on a shared server. You will need to contact Live Support to have them import anything larger than that. You can go ahead and upload the database file to your account, preferably in the home directory or public_html folder. Be sure to indicate the name and location of the file in your request. As always, be sure to verify your request with either the last 4 digits of the credit card on file or the current AMP password if sending an email.
2014-10-01 11:12 am
When you import to an alternative database how can you be sure that all the previous data is removed. Is import destructive or only additive. If you want it to be an exact duplicate of the imported DB do you need to drop the previous tables or delete all the rows?
2014-10-01 11:15 am
Before importing, you will need to drop all previous tables if you are overwriting existing data.