How to import database in phpmyadmin

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.

Advanced users can create and import the database using SSH.

  • Prerequisites
  • Import Database
  • Troubleshooting

Prerequisites

We’ll assume that you’ve already exported your database, and it is either a .sql, zip, or tar.gz file.

If needed, you can make changes to the file using a text editor – e.g. Notepad++ and Atom.io and file compression tools like 7-Zip and The Unarchiver.

You should have already created the new database that you’re importing into as well.

  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).
    How to import database in phpmyadmin
  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.

Congratulations, you have just imported a database!

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.

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.

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. For more details on the mysqlimport command, go to Dev.mysql.com/doc.

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.

Step 1

This step may seem trivial, but you have to be sure you have phpMyAdmin up and running. You can install it either as stand-alone from the phpMyAdmin official site or shipped with XAMPP or WAMPP, based on how you set up your development environment.

Additionally, you must confirm the database you wish to export or the database file you want to import. For example, in this shot, I will export the database in the image below.

For the import, I will be using a file called import.sql.

Step 2

Exporting

This step shows you how to successfully export the jumper database and its table.

  • Go to your phpMyAdmin and navigate to the screen shown in the above image.

  • Scroll through the options ribbon/bar at the top of the screen. Locate and click the export button, as shown below.

Step 3

Leave everything as shown in the image above, or you can make changes you prefer. For example, you can choose a different export format to change yours from SQL (which we are going to be using) to any other.

When that’s done, hit the GO button at the bottom left corner of the screen, as indicated in the image above.

This will cause your browser to pop up something like this.

Choose the save option and click OK. Now, our database has been successfully exported. Check the folder that holds your download files to see the file.

Step 4

Importing

The process to import is quite similar to the export process.

  • First, you have to know the database contained in the file to be imported. For our case, this is the import.sql file. The database file contained in it is the import database.

  • You will have to create a database in your phpMyAdmin, preferably with the same name as that to be imported. It can be any name, or you can even choose any existing database to import the new database tables into it.

Step 5

After deciding which database to use, locate the import option at the top of the screen, just as shown below. Hit the import button and the following screen will be displayed.

Step 6

Hit the browse key to choose your database file from your local storage. Then, hit the Go button indicated below. Wait a few moments and phpMyAdmin will display an “import successful” message. Once more, we have successfully imported a database and its tables.

How to import database in phpmyadmin

How do I import and export a database in phpMyAdmin?

How can I export a database?.
Log in to your Bluehost control panel..
Navigate to the Databases section and select phpMyAdmin..
Once inside, you will see a list of your databases on the left sidebar. ... .
Select the name of the database you would like to export..
Click Export at the top..
Select the Export method you wish to use..

How do I import a WordPress database into phpMyAdmin?

Importing a WordPress Database Backup via phpMyAdmin Simply launch phpMyAdmin and then select your WordPress database. Next, you need to click on the 'Import' link from the top menu. On the next screen, click on the Choose file button and then select your database backup file you downloaded earlier.

How import MySQL database in xampp?

With the XAMPP Control Panel open, start Apache and MySQL, then click the Admin tab on MySQL. Once phpMyAdmin is open, create a new database with the same name as the live database, in my scenario, it will be 000example. On the sidebar, click the newly created database and click the import tab.

How do I connect to a database in phpMyAdmin?

How do I access the database using phpMyAdmin?.
Step 1 - Log in to the control panel. Log in to the one.com control panel. ... .
Step 2 - Select database. Under PhpMyAdmin in the top right, click Select database and choose the database you want to access..
Step 3 - Administer your database..