---
title: "How to Import a MySQL Database using phpMyAdmin"
description: "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...."
url: https://www.inmotionhosting.com/support/server/databases/import-database-using-phpmyadmin/
date: 2011-12-07
modified: 2021-12-17
author: "Brad Markle"
categories: ["Working with Databases"]
type: post
lang: en
---

# How to Import a MySQL Database using phpMyAdmin

Are you planning to share a locally-developed database from your web server? Maybe you’re [migrating a database for WordPress](/support/edu/wordpress/migrating-your-wordpress-database/) 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](/support/edu/cpanel/create-mysql-database/) in cPanel.

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

Advanced users can [create](/support/website/how-to-create-a-mysql-database-using-the-cpanel-api/) and [import the database](/support/website/import-database-through-shell/) using SSH.

- [Prerequisites](#prerequisites)
- [Import Database](#how-to)
- [Troubleshooting](#troubleshooting)

## Prerequisites

We’ll assume that you’ve already [exported your database](/support/server/databases/export-database-using-phpmyadmin/), 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++](/support/website/ftp/connect-ftp-notepad-plus/) and [Atom.io](https://atom.io/)* and file compression tools like [7-Zip](/support/website/compress-file/) and [The Unarchiver](/support/edu/software/uncompress-rar-dr-unarchiver-mac/).

You should have already [created the new database](/support/edu/cpanel/create-mysql-database/) that you’re importing into as well.

## Import Database

1. [Log into cPanel](/support/edu/cpanel/how-to-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).![phpMyAdmin Import Database](https://www.inmotionhosting.com/support/wp-content/uploads/2019/06/phpmyadmin-import-db-1024x553.png)
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](/support/server/databases/mysql-1044-access-denied-error-message/) and a text editor such as [Notepad++](/support/website/ftp/connect-ftp-notepad-plus/) or [Atom.io](https://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](/support/website/import-database-through-shell/). Alternatively, you can [install a phpMyAdmin instance](https://www.inmotionhosting.com/support/website/installing-phpmyadmin-on-your-account/) to import it to your server.

#### VPS / Dedicated Servers

VPS and Dedicated server users with [root access](/support/server/ssh/root-access-faq/) can increase the *max upload size* as needed in WebHost Manager(WHM) Tweak Settings section.

Advanced users with [root access](/support/server/ssh/root-access-faq/) can import a database larger than 50 MB by [logging into MySQL in SSH](/support/server/databases/mysql-command-line/). For more details on the *mysqlimport* command, go to [Dev.mysql.com/doc](https://dev.mysql.com/doc/refman/5.1/en/mysqlimport.html).

**Note:** If you need assistance with importing the process, you can [email our technical support](/support/amp/how-to-get-great-technical-support/#submit-ticket) a verified ticket request with the file and database name.

We also have articles to help you [manage your databases](https://www.inmotionhosting.com/support/server/databases/) and troubleshoot errors – *e.g. [MySQL Error 1064: You have an error in your SQL syntax](/support/server/databases/error-1064/) *. If you have any issues upon importing your database, trying running a check and repair using [cPanel](/support/website/check-repair-database/) or [phpMyAdmin](/support/website/check-and-repair-databases-in-cpanel/).
