Skip to main content
How to Import MySQL Database in phpMyAdmin

How to Import MySQL Database in phpMyAdmin Easily

Let me guess. You came here looking for a way to import MySQL databases, correct? Relax, this time we’ll go over how to import a MySQL database into phpMyAdmin.

For those who are unfamiliar, phpMyAdmin is software that is used to manage and create MySQL databases. Either locally via XAMPP or already online via cPanel hosting.

This time, we’ll go over how to import a MySQL database into phpMyAdmin. You must be eager to try it right away, don’t you?

Without further ado, here is the complete tutorial!

How to Import MySQL Database in phpMyAdmin

Before we begin practicing how to import databases in phpMyAdmin, make sure we have the following two things ready:

  1. Access phpMyAdmin – If we use a local computer, we can access phpMyAdmin through XAMPP. Alternatively, if we are already online, please log in to phpMyAdmin via cPanel hosting. This time, we’ll go with the first option, so make sure we have XAMPP installed on our computer. Learn How to Install XAMPP on Windows (Easiest!).
  2. Database SQL Files – Prepare a SQL file that will be imported into the MySQL database using the phpMyAdmin application.

If we have completed the preceding steps, we can proceed to the steps for importing the MySQL database. These steps are listed in the following order:

  1. Open phpMyAdmin
  2. Select MySQL Database
  3. Import SQL File
  4. Database Import Validation

Let’s start with the first step on how to import the MySQL database, come on!

1. Open phpMyAdmin

The first step in importing a MySQL database is to launch phpMyAdmin from XAMPP. To do so, simply follow these simple steps:

  1. Open XAMPP and click Start on Apache and MySQL to gain access to phpMyAdmin later.
Start Apache and MySQL in XAMPP
Start Apache and MySQL in XAMPP
  1. Launch a web browser. Then, in the address bar, type http://localhost/phpmyadmin and press Enter.
phpMyAdmin Main Page
phpMyAdmin Main Page

We can move on to the next step once the phpMyAdmin main page has loaded.

2. Select MySQL Database

In the third step, we must choose a MySQL database as the destination for the SQL file import. How to?

  1. Select and click the name of the database that will be used as an import on the phpMyAdmin main page’s left sidebar.
List All Databases in phpMyAdmin
List All Databases in phpMyAdmin
  1. If we don’t already have a database, we can create one. Please see the article How to Create a MySQL Database With XAMPP for instructions.
  2. Click the Import menu after selecting the database name.
Import Menu in MySQL Database
Import Menu in MySQL Database

3. Import SQL File

In this case, we simply import the database SQL file as follows:

  1. Click the Choose File button on this page. Then, from the computer, select the SQL file that we prepared earlier.
Choose File on Import Page
Choose File on Import Page
  1. After you’ve chosen the file, scroll down and click the Import button to begin importing the MySQL database.
Import Button on Import Page
Import Button on Import Page
  1. Wait until the MySQL database import is finished. The size of the SQL file determines the length of the database import process. If we try to import a large SQL file, the process will almost certainly take a long time.

We can proceed to the next step to see if the MySQL database import was successful.

4. Database Import Validation

If the database import was successful, we will see the following screen.

Import Was Successful
Import Was Successful

In addition, we can perform some validation using the following steps:

  1. In the left sidebar, click on the database name where it was imported.
  2. Next, ensure that all of the tables in the SQL database are visible.
All the Tables in the Database
All the Tables in the Database
  1. We can also click Browse on the table to simply verify that the contents of the table were correctly imported.
All Data in MySQL Database Table
All Data in MySQL Database Table

At this point, we have successfully imported the MySQL database using phpMyAdmin.


Related post: Login Form PHP MySQL With Session


How to Import Database in phpMyAdmin It’s Easy Right?

In this article, we practiced importing a MySQL database into phpMyAdmin. Despite the fact that this database tutorial is performed on a local computer, we can test it on cPanel hosting. Because the steps aren’t that dissimilar.

If you have any problems or questions, please post them in the comments section. Thank you very much.

Share this

Shafy Gunawan

I’m a web developer. I spend my whole day, practically every day, experimenting with HTML, CSS, JavaScript, and PHP; dabbling with Python programming language; and share the knowledge that I learned.

Leave a Reply

Your email address will not be published. Required fields are marked *