Import a Large SQL File in phpMyAdmin
A large SQL file fails in phpMyAdmin when it is bigger than upload_max_filesize or post_max_size. Gzip it to .sql.gz and use Import, or upload the dump with File Manager and run mysql from cPanel Terminal. The import worked when the tables show under that database and a row count matches the source.
For cPanel users restoring or migrating a database dump that phpMyAdmin rejects as too large or that times out part-way through.
knowledge
- Read time
- 5 min
- Sections
- 6
- Updated
- 14 Nov 2026
- Written by
- WebJi® team
Last editorial update: 14 November 2026.
Why does a large SQL file fail to import in phpMyAdmin?
phpMyAdmin rejects a SQL file when it is larger than PHP’s upload_max_filesize or post_max_size, or stops part-way when the import outlasts max_execution_time. Pick the fix from the Max size phpMyAdmin prints, not from a fixed megabyte number.
- The Import tab prints the cap as Max, next to the file field. That number is the smaller of the PHP upload limit and the post limit.
- "You probably tried to upload a file that is too large" means the browser POST was refused before MySQL read a statement.
- A timeout is a different failure. The file uploads, then the page dies while statements are still running.
| Path | Use it when | Done when |
|---|---|---|
| Import or .sql.gz | The file is under the Max shown on the Import tab. | The left column lists the tables and a count matches. |
| cPanel Terminal | Gzip is still over that Max, or the page dies mid-run. | The shell returns with no ERROR line. |
| MultiPHP INI Editor | The editor still has room under the server ceiling. | Import shows a higher Max and the file then fits. |
| Email support | Terminal is missing, or the ceiling is still too low. | You sent the domain, database name, and file size. |
How to import a large SQL file through the phpMyAdmin Import tab
Use the Import tab when the .sql, or a gzip of it, is under the Max size on that screen. The database has to exist first, with the cPanel prefix on its name. The cPanel MySQL database guide shows how to add the user and tick All Privileges.
- In cPanel, open phpMyAdmin and click the destination database. It must already exist. A dump that starts with CREATE DATABASE or USE often fails here, because the account cannot create an unprefixed database. Import into the empty database you made.
- Open the Import tab and read the Max size under the file field. If the .sql on your computer is larger than that number, do not click Go yet.
- If the .sql is under that Max, choose the .sql file. If it is over, gzip it so the name ends in .sql.gz and choose the .gz file. phpMyAdmin unpacks gzip before it runs the statements. A zip that contains only the dump works the same way.
- Leave Format as SQL. Keep “Allow the interruption of an import in case the script detects it is close to the PHP timeout limit” ticked: if the run stops, phpMyAdmin reports how many queries it finished, and you can resubmit the same file with that number in “Skip this number of queries”. Click Go.
- You are done in the browser when a success notice shows and the left column lists the tables. If the page says the file is too large, the gzip is still over the cap. Use Terminal.
How to import a large SQL file from cPanel Terminal
Use Terminal when the gzip is still over the Max, or the browser dies after the upload finishes. PHP is not on this path, so upload_max_filesize does not apply. On cPanel hosting, Terminal sits under Advanced when the plan allows shell access. If that icon is missing, email support@webji.services. Do not put the dump in a public folder to get around it.
In File Manager, upload dump.sql into the home directory, not public_html. A .sql under the site can be downloaded by anyone who guesses the address. Open Terminal and run the command below with your prefixed MySQL user and database name.
mysql -u cpaneluser_dbuser -p cpaneluser_dbname < /home/cpaneluser/dump.sql
# a gzipped dump can be streamed without unpacking it first
gunzip < /home/cpaneluser/dump.sql.gz | mysql -u cpaneluser_dbuser -p cpaneluser_dbname
# make the gzip on your own computer before uploading
gzip -k dump.sqlType the MySQL password at the prompt. It is not your cPanel password. No ERROR line, and a fresh prompt, means the client finished. Keep the file until the table check passes, then delete it from the home directory.
Which PHP limits can you raise for phpMyAdmin imports?
The Max figure is the smaller of upload_max_filesize and post_max_size. post_max_size has to stay larger than the upload limit, or the form still rejects the file. max_execution_time and memory_limit decide whether an uploaded file can finish.
MultiPHP INI Editor can raise those four for the account, up to a ceiling the server already set. Save, reopen Import, and read the new Max. If the editor will not go high enough, stop. A private php.ini that asks for a huge cap is ignored on shared hosting, and you cannot restart the web server yourself.
Numbers you set in local XAMPP apply to your computer, not to this host. A CSV upload on the same Import tab is a different job and will not load a .sql dump.
What to do when a phpMyAdmin import stops halfway
A timeout leaves some tables behind, then the page goes blank or shows an error. If the dump has no DROP TABLE, a second Import stops on table already exists or writes the same rows again. Do not click Go a second time on a half-loaded database.
If the message is MySQL server has gone away, one INSERT is bigger than the server packet. The MySQL server has gone away note explains that line. On shared hosting you cannot change the global packet size. Email the exact line and the file size.
Open the database in phpMyAdmin. If only some tables arrived, keep the dump, remove those partial tables, and import once from Terminal into a clean database.
How to confirm a large SQL import worked
You are finished when the left column lists the tables from the dump and a count on a large table matches the source. Open one row you recognise, such as a recent order or the WordPress admin user. A success notice with an empty left column means the file ran against another database, often because it contained the USE line.
Delete the dump from the home directory after that check. Delete a copy from public_html too, if one is there.
A later restore is a new import, not a second pass over live tables. Email support@webji.services with the domain, the database name, and the file size if you want this run for you. The work is quoted before it starts. The office phone is not a support line.
Sources: phpMyAdmin documentation, “Import and export” (compression formats, partial import and skip-queries options); PHP manual for upload_max_filesize, post_max_size and max_execution_time; MySQL reference manual for the mysql client.
Frequently asked questions
How do I import a large SQL file in phpMyAdmin?
Gzip the .sql to .sql.gz and use Import if that file is under the Max size on the tab. If it is still larger, upload the .sql to the home directory and run mysql from cPanel Terminal. You are done when the tables are listed and a row count matches the source.
Why does phpMyAdmin say the file is too large?
The form rejected the upload before MySQL started. The file is over upload_max_filesize or post_max_size. Read the Max figure on the Import tab. Gzip often gets a text dump under that figure. It does nothing if the .sql.gz is still over the cap.
How do I increase the phpMyAdmin import size in cPanel?
Open MultiPHP INI Editor, raise upload_max_filesize, and set post_max_size higher than that. Raise max_execution_time only if the file uploads and the page then dies. Reopen Import and read the new Max. If the editor is already at its ceiling, use Terminal.
How do I import a SQL file with mysql in cPanel Terminal?
Upload the .sql outside public_html. In Terminal run mysql -u user -p database < /home/user/dump.sql with the prefixed user and database name. Enter the MySQL password. A new prompt and no ERROR line means the client finished.
Can phpMyAdmin import a .sql.gz file?
Yes. Choose the .gz file on the Import tab and leave Format as SQL. phpMyAdmin unpacks gzip before it runs the statements. A zip of the dump works the same way. The archive should hold the SQL file, not a mix of other files.
Why did the phpMyAdmin import stop halfway?
The script hit its time or memory limit after some statements had already saved. Do not run Import again on that half-loaded database. Keep the dump, remove the partial tables, and import once from Terminal.
Last editorial update: 15 November 2026.
Ready to get started with WebJi®?
Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.