Web Hosting

Please find below our list of Web Hosting guides to help with your hosting account.

How to import a database using phpMyAdmin

This article was posted in: Web Hosting

This article will show you how you can import a database from a file on your local computer to your Krystal cPanel account. This article assumes that you are already successfully logged into cPanel.

Step 1 - Create a database if you have not already done so

Before you can import a database dump file from your computer, a destination database must already exist within your cPanel account. Please see the article How to configure MySQL databases in cPanel.

Step 1 - Open the phpMyAdmin web application

Open the phpMyAdmin web application by clicking on the phpMyAdmin icon in the Databases section of cPanel.

Step 2 - Select your database

Once phpMyAdmin opens, you will see down the left margin a list of databases to which you have access. information_schema is a special database that holds information "about" your databases - you do not need to access this.

Click on the name of the database you want to import your data into - in the below case, krystald_testing.

Step 3 - View Import settings

Click on the Import tab.

Step 4 - Import your data

  • Click the Choose File button and browse your computer for your MySQL dump file (usually named *.sql)
  • That's it - the default options will normally work fine for you. Just click the Go button!

Step 5 - Any Errors?

A common error that occurs looks like the one shown below. This is because your database dump file contained instructions to create a specific database name. This is not allowed, because we are importing data into a known (predefined) database. To prevent this error re-occuring you must comment out or remove the lines that are highlighted (in this case, remove the line that reads CREATE DATABASE etc..)