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
- 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.
- 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.
- Raise the Nginx body limit. If Nginx fronts phpMyAdmin, set client_max_body_size to at least the same size and reload Nginx.
- 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.
- 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.
- 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