How to import a database with phpMyAdmin?
The phpMyAdmin function offers users many utilities, one of which is the "Import" option. It can be used to efficiently migrate a website's database if you have the SQL file available, or to create a staging version of your website. In this tutorial, we will show you how to use phpMyAdmin to import an SQL file into a database you have already created. If you are not sure how to create a database, you can find a good tutorial on this topic on our website: How to create a MySQL database with cPanel
Access to phpMyAdmin
Before you can access the phpMyAdmin functionality, you need to log into your cPanel account with us. Please read our cPanel instructions for more information: How can I log in to the cPanel?
Once you are logged in, please navigate to the "Database" section. There, click on the "phpMyAdmin" icon.
When you click on phpMyAdmin, you will be redirected to "PHPMyAdmin". In the left sidebar you will see a list of all your databases.
New to phpMyAdmin? We will show you what it is: What is PHPMyAdmin and where can I access it?
Import a database
Select the new database into which the SQL file will be imported.
Click the Import tab on the top toolbar to access the import function.
When you get to the "Import" page, you will see several sections. Let's go through them to get a better understanding of all the available settings:
File to import section
Under the "File to import" section you will find the "Select file" button. When you click this button, a pop-up window appears where you can select a file. This file can be an SQL file, an XML file, a CSV file, or an archived file that contains such a file, for example, a gzip, bzip2, or zip compressed archive.
After you select the file, phpMyAdmin will upload it and import all tables of the selected database. You can also drag and drop the file from your computer to the import screen of phpMyAdmin to start the process.
Note that you cannot select a file that is larger than 200 MB. This limit was introduced to prevent importing large SQL files with slow and unoptimized queries, which can cause a dramatic drop in performance of the entire server.
The last option in this section is the "File Character Set" drop-down menu. Here you can select the character set of the file to be uploaded. In most cases, you should keep the default setting utf-8.
Partial import section
Since phpMyAdmin is written in PHP, it can use all server-side PHP settings, including time limits.
If you check the box, phpMyAdmin can abort the import process if it detects that it is approaching timeout. This is useful when you are uploading large files. However, it may cause MySQL to save the results of partial operations (failed transactions).
You can enter a set of SQL queries that you want phpMyAdmin to skip during the import process in the text box below.
In the "Other options" section you will see only one check box. You can enable or disable foreign key checking during import.
In the "Format" section you can select the format of the file to be imported - e.g. SQL, XML or CSV.
Section for format-specific options
The last section on this page is the Format Specific Options section. Here you can further customize the format of the file you are importing. Using the drop-down menu you can select a specific SQL compatibility mode, for example, if you are importing a file created on a server with an older MySQL version.
By activating the check box below this drop-down field, the AUTO_INCREMENT instruction for zero values can be deactivated. If you deactivate the check box, the instruction for zero values is activated.
After you have made the import settings, please click the "OK" button at the bottom left of the screen. This will start the import process and after completion you will receive a success message.
Here it is! The import function within the phpMyAdmin service makes it easy! If you have technical problems or can't import a certain file yourself, please contact our support team! You can reach us around the clock via the Ticketing system on our website.
Not yet a customer of ORC Webhosting?
Then it's time to change!
You read our help article, but you are a customer of another hoster? A bit cheeky, isn't it?
Are you looking for better web hosting? Maybe not, but certainly better support, otherwise you wouldn't have ended up here.