Ffile2fix
Sign in Get started

How to fix phpMyAdmin "tried to upload a file that is too large"

You probably tried to upload a file that is too large. Please refer to the documentation for a workaround for this limit.

phpMyAdmin imports files through a normal PHP upload, so they are limited by upload_max_filesize and post_max_size (shown as 'Max: 2,048KiB' or similar on the Import tab). When your SQL file exceeds those limits, PHP discards it and phpMyAdmin shows this message.

Also appears as: No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. · phpMyAdmin Max: 2,048KiB import limit · Script timeout passed, if you want to finish import, please resubmit the same file and import will resume.

Common causes

  • The SQL dump is larger than upload_max_filesize
  • post_max_size is smaller than the file (it must be equal or larger than upload_max_filesize)
  • Nginx client_max_body_size or a proxy limit rejecting the upload
  • Shared hosting caps that you can't raise above a fixed value
  • The import starts but exceeds max_execution_time (the 'Script timeout passed' variant)

How to fix it

  1. Compress the dump. phpMyAdmin accepts .sql.gz and .zip files. Gzipping a SQL dump often shrinks it by 80-90%, which may fit under the limit.
  2. Raise PHP upload limits. In cPanel MultiPHP INI Editor or your php.ini set upload_max_filesize and post_max_size above the file size, plus a higher max_execution_time. Restart PHP-FPM on a VPS.
  3. Raise the Nginx body limit. If Nginx fronts phpMyAdmin, set client_max_body_size to at least the same size and reload Nginx.
  4. Import via SSH instead. Upload the file over SFTP and run mysql -u user -p dbname < dump.sql. This has no upload limit and is far more reliable for big databases.
  5. Use phpMyAdmin's UploadDir. On your own server, set $cfg['UploadDir'] in config.inc.php, place the file there, and choose it from the 'Select from the web server upload directory' list.
  6. Split the file. If you only have phpMyAdmin access on shared hosting, split the dump into smaller parts by table and import them one by one, or ask the host to import it.

php.ini / .user.ini and SSH

upload_max_filesize = 256M
post_max_size = 256M
max_execution_time = 600
memory_limit = 512M

# or skip phpMyAdmin entirely
gunzip < dump.sql.gz | mysql -u dbuser -p dbname

How to stop it happening again

  • Export large databases compressed (gzip)
  • Use SSH or a CLI tool for databases over a few hundred MB
  • Exclude cache, log and session tables from exports to keep dumps small

Frequently asked questions

I raised upload_max_filesize but the limit didn't change. Why?

post_max_size must also be at least as large, and you may have edited a php.ini that isn't loaded. Check the 'Max:' value on the Import tab, which reflects the effective limits.

What does 'Script timeout passed' mean?

The upload worked but the import ran past max_execution_time. phpMyAdmin can resume if you resubmit the same file, but raising the time limit or importing over SSH is more reliable.

Can I import a .zip with several SQL files?

phpMyAdmin reads a ZIP containing a single SQL file. For multiple files, import them separately or combine them into one dump first.