How to Import Large SQL File in PhpMyAdmin
Table of Contents
How to Import Large SQL File in PhpMyAdmin? This is the most sought question for those who were helpless in a situation where they wanted to upload a MySQL file larger than 50MB into their database for their project or website.
Even when you can able to import larger than 50MB files, you often face exceeding timeout or 504 Gateway Time-out.
We cover everything in this article that you need to pass this challenging technical process hassle-free in cPanel.
Purpose and Fix Import Large SQL File:
When transferring sites from other providers to us, you must upload the database files in PhpMyAdmin to manually restore the site. By default, cPanel phpMyAdmin allows you to import up to 50MB of SQL files which is the server’s default limit for a cPanel account.
Sometimes, your website requires to Import Large SQL File greater than 50MB, which can’t be uploaded directly to PhpMyAdmin. So your migration process or need to connect the database with your website files will be half done. This can be resolved in two ways through the backup option in cPanel and zip file format through phpMyAdmin.
After Importing a database over 50mb in cPanel, you might still face issues with disk space exceeded or database limit exceeded since we are overwriting past the allocated limit. But you can increase the disk space limit which will eventually increase the database limit as well for the website with help of our support team.
Methods to Import Large SQL File to Database:
1. Backup Option in cPanel
2. Compress and Import Large SQL File to Zip Format
Method 1: Backup Option in cPanel
Step 1: Login to cPanel. If you have can’t locate the cPanel credentials for the website, reach our support team.
Step 2: Navigate to Files Section and click ‘backup‘ option.
Step 3: Under partial Backup section, click ‘Restore a Database backup’ which is on your right side.
Step 4: Upload the SQL file and click “Upload” button to proceed.
Once it is uploaded successfully, you will receive a message as shown in the below screenshot.
Method 2: Compress and Import Large SQL File to Zip Format
You can follow this method if the compressed file size is below 50MB by keeping with the default limit set to 50MB.
Step 1: In windows 11 once you download the SQL file, right click on the file in your mouse and select compress to -> Additional options.
NOTE: Compress option name varies based on OS version. Choose the gzip format for quick upload.
Step 2: In Compression Method, choose Gzip format from the drop and adjust the level as you wish. Click ‘Create‘ button to create the zip file.
Step 3: Once done, you can see the zip file format as “.sql.gz” which is supported zip format in phpMyAdmin.
Step 4: Now login to cPanel -> click PhpMyAdmin option.
Step 5: Click the database name to which you want to import the zip file.
Step 6: Click “Import” option on top of the table and then click “Choose” button to upload the zip file. Once done, scroll down to bottom of the page and click “Import” to complete the process.
Useful Additional Resource:
2. How to Take Database Backup Through cPanel?
3. Error in Establishing Database Connection WordPress
4. About MySQL
Hope this article helps you import larger MySQL database easily for your website.