Import database in phpMyAdmin


EXPERIENCING PROBLEMS WITH OUR SERVICES? RUN A DIAGNOSE FIRST TO SAVE YOURS AND OUR TIME

Added: 10.03.2014 23:26:29     Last updated: 13.01.2017 14:38:12

This guide details how to import a database in phpMyAdmin. To import a database you must export the database you want to import. The guide Export of database in phpMyAdmin details this.

Step 1:
Before we can import the database, we must know the following:

  1. DBMS for exported database
    We must know which DBMS (Database management system - like MySQL) was used on the server the database was exported from. If you have exported via phpMyAdmin, which DBMS was used will be listed at the top of the file like in the example below:

    -- phpMyAdmin SQL Dump
    -- version 4.0.10.7
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generated: 28. Sep, 2015 10:09 AM
    -- Server version: 5.5.42
    -- PHP version: 5.4.31

    In this case, MySQL 5.5.42 was used. Step 2 pt. 1 of Export of database in phpMyAdmin also show the same. If you are unsure, you can ask the provider of the server you exported the database from.
     
  2. DBMS compatibility
    We must know if the database was exported to be compatibel with a specific DBMS. If that's the case, point 1 can be ignored. The person who exported the database will know if it was exported for a specific DBMS when this is chosen during export. It is not easy figuring this out in the aftermath. Step 5 pt. 6 of Export database in phpMyAdmin shows how compatibility is chosen during export in phpMyAdmin.
     
  3. Charset for exported file
    We must know which charset the file that contains the export of the database is using. If you specify the wrong charset when importing, will characters like æøå not be shown correctly on the websites after the database has been imported. "utf8" is standard when exporting in phpMyAdmin. If "utf8" doesn't work like desired, you should try "latin1".

Step 2:
Click on the icon for "phpMyAdmin" as shown in the screenshot below in cPanel:
 

phpMyAdmin icon in cPanel

Step 3:

  1. Notice which version of MySQL is being run on the server you are importing the database to, since this is relevant in regards to pt. 1 og 2 in step 1.
  2. Click on the database you want to import the database to in the list of databases. In this case it will be the database "exampque_wp380"
  3. Click on "Import"

phpMyAdmin home page


Step 4:

  1. Click on "Browse" to pick the file you want to import.
  2. Choose charset for the file. See step 1 pt. 3.
  3. Choose which format the file has. Unless you have been given instructions to do otherwise, you pick "SQL" here.
  4. Choose SQL compatibility for the file. See step 1 pt. 1 and 2. Usually, "NONE" will be the correct choice.
  5. Click "Perform".

phpMyAdmin import page


Step 5:

  1. When the import is done, you will see a confirmation, like in the picture below. If there is something wrong, this is where you will be notified.
  2. The imported tables in the database can be seen in the left column in phpMyAdmin.
phpMyAdmin after import

Done
We have now been through how to import a database in phpMyAdmin.