InMotion Hosting Support Center

In this tutorial:

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

Prerequisites

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.

How to:

  1. how-to-use-phpmyadmin-to-import-a-database Log into cPanel
  2. Open phpMyAdmin by clicking the phpMyAdmin icon
  3. Select the database in the left menu 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 be either a .sql .zip or .tar.gz file).
  6. Click Go at the bottom right
  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.

    Congratulations, you have just imported a database!

Troubleshooting

#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.

Shared servers

For users on shared hosting, you can follow these steps to import a database larger than 50MB.

Support Center Login

Social Media Login

   
Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2014-09-10 10:55 am
u should let people know how to create the database before actually going ahead to import.some dont know.i knew it already and to me this was cool and direct.
kudos!
n/a Points
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. 

Staff
38,359 Points
2014-09-11 6:39 am
Hello adesh,

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.

Kindest Regards,
Scott M
n/a Points
2015-07-13 6:54 am

I have different kinds of database files with me I dont know how to import those files (like, OPT, FRM, MYI, etc)

can anyone suggest what to do?

Staff
38,359 Points
2015-07-13 2:40 pm
PhpMyAdmin allows for the following import formats: SQL, MediaWiki Table, OpenDocument Spreadsheet, CSV, ESRI Shape File, or XML
n/a Points
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?
Staff
11,186 Points
2014-10-01 11:15 am
Before importing, you will need to drop all previous tables if you are overwriting existing data.
n/a Points
2015-01-26 5:52 pm

i get this error when tray to import a file of 33mb size

"The connection was reset"

Staff
38,359 Points
2015-01-26 6:31 pm
Hello Atman,

Typically, waiting a bit should clear this up. If you continue to receive the error, you will want to contact our Live Support department to have them take a look at your individual situation.

Kindest Regards,
Scott M
n/a Points
2015-02-02 3:01 pm

Hi, 

I am new to using phpMyadmin. I followed your procedure and the import was successfull. However after importing, if I click on "My Website" in it, i get error in connection. I already have any existing website in wordpress and would like to know how I should connect it to the phpMyadmin.

 

thanks.

Staff
33,681 Points
2015-02-02 4:31 pm
Hello Vishal,

If you imported the installation, then you would have needed to change the settings for the database in your wp-config.php file. Check out this article for further assistance: Error Establishing Database Connection. You may also need to review this tutorial on finding your database name.

I hope this helps to answer your question, please let us know if you require any further assistance.
Regards,
Arnel C.

n/a Points
2015-02-03 2:13 am

Created my db just fine along with a db user just fine.  But when I import it says i do not have permission to create a table.  Issue is this:  My cpanel login is 'xy' (not really).  All users that I create for the db have to be 'x_' something.  When I go into phpMyAdmin, it never asks me to login, it just lets me in and says I am 'xy'@'localhost'.  My question is how to I tell phpMyAdmin to be 'x_dbuser'@'localhost' (which I created) instead of 'xy'@'localhost' (who I cannot create as a db user and so does not have access to the db)?  It must be something simple but I cannot find it.

Staff
11,186 Points
2015-02-03 9:59 am
The main cPanel user should have access to all databases. Could you provide the exact error you are getting?
n/a Points
2015-02-18 3:08 pm

Hi Jeff,

I'd be happy if you can help me.

I backed my files by ftp.

My host opened a new domain name. And created a brand new site.

I updated the wp-config file and tried to import it bu phpmyadmin, but with no success.

I sent all my old files to the new site by ftp.

Is there any missing logic on my actions?

Also is the database only wp-config ? 

Thanks

Staff
10,077 Points
2015-02-20 11:05 am
Hello Baris,

I believe there is some miscommunication somewhere as the wp-config.php file has the database connection information and is not the database itself. I would suggest contacting your old host and request a backup of the database specifically as you can not back up the database solely from FTP.

Best Regards,
TJ Edens
n/a Points
2015-03-15 5:16 am

 

 

Thanks for the info Tj. =)

n/a Points
2015-03-14 12:00 pm

I had a crash on my site, exported a .sql database file. Created a new database inviroment and installed a new version of concrete5 on to de database. When uploading the exported .sql file i get a error #1054 - Unknown column 'fvHasThumbnail1' in 'field list'.

Trying to get it to run again, any help is greatly appriciated. If needed i can share the .sql file.

Staff
38,359 Points
2015-03-16 4:36 pm
Hello Olaf,

That error is when the query attempts to put data from a column in to a table and the database cannot locate that particular column. Be sure to check for spelling errors in either the query or the database itself.

Kindest Regards,
Scott M
n/a Points
2015-04-01 2:13 pm

Hello there, 

 

i had successfully imported the database to the myphpadmin , but still it does not connecting with my website , will u please sort out the problems

Staff
33,681 Points
2015-04-02 10:40 am
Hello Praveen,

Sorry to hear that you're having problems with the database. However, we need more specific information in order to help you with the connection issue. Do you have an account with InMotion? If not, can you please provide the error message you're seeing as well as the configuration information used for connecting to the database? The connection parameters should be verified so that we can at least rule it out.

Regards,
Arnel C.
n/a Points
2015-05-04 1:45 am

I have a website hosted with InMotion, and I used a WordPress plugin to give me a weekly backup of what I assume is the database. The file it sends me each week is a .zip file.

 

The instructions for restoring this backup are the same as what is outilined here:  go to phpMyAdmin in Cpanel, select the appropriate database, select "Import", navigate to the backup file and click on the "Go" button. This is supposed to restore the database to the backup version.

My question is whether this actually replaces the old database with the backup. Does this process remove the old database and replace it with the imported backup? It doesn't really make that clear. I'm worried that I'll just be duplicating all  the content or otherwise making things worse. Do I have to somehow remove the old database first BEFORE I import the backup file or is that done automatically?

 

Thank you very much for your help.

 

Doug Nienhuis

 

Staff
38,359 Points
2015-05-04 8:10 am
Hello Doug,

Yes, the restore will replace the existing database so no data will be duplicated. You can always remove all the data in the database if you like by selecting all the tables and "DROP"ing them. This would give you an empty database shell to restore to. It is an additional step, but a good one if you are not quite certain.

Kindest Regards,
Scott M
n/a Points
2015-05-15 12:58 am

Hi,

I am new to using phpMyadmin.I had a crash on my site, exported a .sql database file. Created a new database inviroment and installed a new version of concrete5 on to de database. When uploading the exported .sql file i get a error #1062 - Duplicate entry '1' for key 'PRIMARY'

Staff
33,681 Points
2015-05-15 2:39 pm
Hello Minkoko,

Sorry to hear you're having problems with the database error. I looked in Concrete's support forum and if you review the posts, they have a possible solution. Please see the Concrete 5 Support forums in regards to this error and they be able to provide a fix for you.

Regards,
Arnel C.
n/a Points
2015-06-10 3:07 am

Erro

 

Comando SQL:

 

---- Database: `joomla`---- ------------------------------------------------------------ Table structure for table `#__assets`-- CREATE TABLE IF NOT EXISTS `#__assets` (

`id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary Key', `parent_id` int( 11 ) NOT NULL DEFAULT 0 COMMENT 'Nested set parent.', `lft` int( 11 ) NOT NULL DEFAULT 0 COMMENT 'Nested set lft.', `rgt` int( 11 ) NOT NULL DEFAULT 0 COMMENT 'Nested set rgt.', `level` int( 10 ) unsigned NOT NULL COMMENT 'The cached level in the nested tree.', `name` varchar( 50 ) NOT NULL COMMENT 'The unique name for the asset.\n', `title` varchar( 100 ) NOT NULL COMMENT 'The descriptive title for the asset.', `rules` varchar( 5120 ) NOT NULL COMMENT 'JSON encoded access control.', PRIMARY KEY ( `id` ) , UNIQUE KEY `idx_asset_name` ( `name` ) , KEY `idx_lft_rgt` ( `lft` , `rgt` ) , KEY `idx_parent_id` ( `parent_id` )

) ENGINE = MYISAM DEFAULT CHARSET = utf8;

Mensagens do MySQL : Documentação

#1046 - No database selected

Staff
33,681 Points
2015-06-11 3:20 am
Hello Abilio,

Apologies for the problem that you're seeing. However, the issue centers around your code NOT selecting a specific database. You may need to speak with a developer if you are unable to correct that issue. We unfortunately cannot correct the code for you.

Kindest regards,
Arnel C.
n/a Points
2015-07-18 7:30 pm

I get this when I try importing SQL file. Pls someone should help me out on how to solve this problem:

 

Error

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unknown Punctuation String @ 15
STR: ><
SQL: <!DOCTYPE HTML><html lang='en' dir='ltr' class='safari safari4'><meta charset="utf-8" /><meta name="robots" content="noindex,nofollow" /><meta http-equiv="X-UA-Compatible" content="IE=Edge"><style>html{display: none;

 

SQL query:

<!DOCTYPE HTML><html lang='en' dir='ltr' class='safari safari4'><meta charset="utf-8" /><meta name="robots" content="noindex,nofollow" /><meta http-equiv="X-UA-Compatible" content="IE=Edge"><style>html{display: none;

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser

Staff
38,359 Points
2015-07-20 4:11 pm
Hello Nestor,

The reason for the error is that the data it is reading is not SQL, but HTML. PhpMyAdmin cannot import HTML and convert it to a database. It needs to have a regular SQL Query in order to do so.

Kindest Regards,
Scott M
n/a Points
2015-09-02 11:49 am

i am deploying my project,its done successfully and imported database into online database .the problem i'm getting is there no db update and no connetion estabilesh while connection online server..

 

help dude. 

Staff
33,681 Points
2015-09-02 10:47 pm
Hello Anil,

Sorry for the problem with the database connection. Can you please provide us some information about your database and your account? We would that information in order to investigate the issue further. Otherwise, you are welcome to submit a ticket to our live technical support team. They can investigate the issue privately so that your connection information is not published in a reply on this page.

Please provide us a little more information, or submit a support ticket to our live tech support team and we can investigate the issue in more depth.

Regards,
Arnel C.
n/a Points
2015-10-29 12:13 pm

Hello guys!

I'm interested is there any way i can automatically import a database with phpMyAdmin at a given interval? I'd like to have phpMyAdmin import a database from a specific location every 24 hours, or any interval that i like. 

I know how to creat a MySQL Event, if that helps.

Staff
33,681 Points
2015-10-29 12:38 pm
Hello Nick,

Currently, the only way to do that is to create a CRON job that launches a script for the database import. The import would need to be written to be executed via command line using MySQL. Check out how to run a cron job for further details.

If you have any further questions or comments, please let us know.

Regards,
Arnel C.
2015-11-22 4:35 am
Hello,

I am having issues importing a sql database backup from my old host to a blank database here. I get no errors but the database is still blank and I get no confirmation of completion. I have been able to import the backup to my old host to a blank database and it works fine and i get confirmation that it was successful. One thing i noticed between the two hosts is that my old host, i have to login with the sql username, here there is no way to login as the sql user.
Staff
11,237 Points
2015-11-23 11:26 am
How large is the import? It may be failing due to size, which, in that case we can help you with the import.
n/a Points
2015-12-16 2:43 am

Hi,

I get the following error during import:

 

Error

 

SQL query:

 

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;/*!40101 SET NAMES utf8 */;---- Database: `moyie_wrdp59`---- ------------------------------------------------------------ Table structure for table `wp_commentmeta`-- DROP TABLE IF EXISTS `wp_commentmeta` ;

 

MySQL said: Documentation

#1046 - No database selected

Kindly direct me on how to fix this.

Regards

Habyb

Staff
33,681 Points
2015-12-16 11:37 am
Hello Habyb,

When you import a database, you should be specifying database you are importing TO. In the steps above, you will have needed to have selected an existing database to do this. You should not be choosing a database with these same tables already created. Check out How to create a MySQL database in cPanel if needed. If you're importing into a blank database, then it should be no problem. Make sure that your file is no larger than 50 MB as there is a limit to the import size using phpMyAdmin.

If you have any further questions or comments, please let us know.

Regards,
Arnel C.
n/a Points
2016-02-26 2:43 pm

I GET "PARSE OR FATAL ERROR" WHEN CONNECTING OR SELECTING FROM THE DATABASE

Staff
10,077 Points
2016-02-26 3:21 pm
Hello Yobo,

Where are you seeing that message?

Best Regards,
TJ Edens
n/a Points
2015-12-16 3:19 pm

Hello Sir/ Ma'am,

I have a windows hosting for asp.net but I want to upload a website which developed by wordpress. where used mysql database. How to upload and configure it? please reply me as soon as possible.

Regards

Hafizul Sk

Staff
33,681 Points
2015-12-16 3:45 pm
Hello Hafizul,

Thanks for the question. We do not provide support for other types of servers unfortunately, but you may find the answers to what you're looking to do by going to this article on using WordPress on Microsoft Servers. I hope this helps to answer your question, please let us know if you require any further assistance.

Regards,
Arnel C.
n/a Points
2016-04-21 1:43 am

hi,

I want to add a created database in localhost to available database on webhost, so that the tables of both(local&web host) are exactly same but their informations are different. Now I want by importing, add the data on local tables to same table on webhost.

Please help me, if it is possible!

thanks 

Staff
38,359 Points
2016-04-21 7:45 am
Hello Stephan,

I am not quite sure what you mean. Are you wanting to simply import the structure of the database, but no data? You may want to import the database so you get the structure and then delete the content with short SQL queries. Then you will have an empty database in which you can input your new data.

Kindest Regards,
Scott M
n/a Points
2016-05-24 5:20 am
Sir i faced this following erreo at the uploading time. Please solve this problem..
#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation
[
Staff
11,237 Points
2016-05-24 7:03 am
You do not have the correct privileges assigned to your MySQL user. Here's the command to do so:
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
n/a Points
2016-05-25 3:29 pm

HI I'm getting an error #1146 - Table 'zamaadmi_cfm.wp_posts' doesn't exist

Because not all my tables were imported... I did the export from my local twice already following the given steps as well as the import but still not all my tables are there on the server.
Staff
33,681 Points
2016-05-25 5:42 pm
Hello Zama,

Sorry for the problems with the database import. You will need to see why the data is not importing. It's possible that the data does not match the old location to the new. There may also be corrupt data causing the import to fail. You will need to look at the import and see if there are errors occurring during the import process. Additionally, is the table "zamaadmi_cfm.wp_post" supposed to exist? By default, the "wp_posts" table is required within the WordPress database. If you are an InMotion Hosting customer, the name of database uses the prefix of based on the user name of the account. If that is not the correct database name (or prefix), then what part of WordPress is requesting the table. If you had caching turned on BEFORE you made the import, then it should have been turned off, or the saved cache could be trying to refer to the database from the previous location.

I hope this helps to answer your question and point you in the right direction. Please let us know if you require any further assistance.

Regards,
Arnel C.
n/a Points
2016-05-29 5:41 am

Nice article . I loved the points , Does anyone know if my company might be able to obtain a blank TREC 9-6 example to edit ?

Staff
38,359 Points
2016-05-31 10:59 am
I'm not sure what specifically that is, but when Googling "TREC 9-6", Google did give some pdf links for different forms.
n/a Points
2016-06-07 4:11 am

hello sir

i am getting this error while importing the database into myphpadmin?

SQL query:

---- Database: `wordpress`---- ------------------------------------------------------------ Table structure for table `wp_commentmeta`-- CREATE TABLE `wp_commentmeta` (

`meta_id` bigint( 20 ) UNSIGNED NOT NULL , `comment_id` bigint( 20 ) UNSIGNED NOT NULL DEFAULT '0', `meta_key` varchar( 255 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL , `meta_value` longtext COLLATE utf8mb4_unicode_ci

) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

 

MySQL said: Documentation

#1046 - No database selected 

 

 

 

thanks

Staff
4,404 Points
2016-06-07 8:12 am
You must select the database first and then "Import" tab. If you use the Import option first without selecting a database it will generate this error.
n/a Points
2016-06-13 11:55 am

I'm getting an error when attempting to import a new DB using phpMyAdmin as follows;

#1115 - Unknown character set: 'utf8mb4'

My research indicates that this is due to an older version of MySQL being used on the server. Is this correct and is there a solution?

Staff
4,404 Points
2016-06-13 12:21 pm
Yes, your assertion seems to be correct. It looks like you may need to update your MySQL to a newer version.

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

55 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!