Someone hands you a 400MB SQL dump and asks for it imported into their cPanel account. They’ve already tried phpMyAdmin — Import tab, browse, upload, and the browser sits at “uploading” for ten minutes before returning either a blank page or a 504. They tried again with the file gzipped to 60MB; same result. phpMyAdmin’s web form is a thin wrapper over PHP, and PHP on cPanel has a row of timeouts and size limits between the upload button and the actual MySQL import. The browser is the wrong tool for anything over about 100MB, and the answer is not “raise all the limits.”
What’s happening
A phpMyAdmin import touches four ceilings, any of which kills the request: upload_max_filesize (PHP — how big a file the upload accepts), post_max_size (PHP — how big the POST body containing the file can be), max_execution_time and max_input_time (PHP — how long the script can run and how long input parsing can take), and the LiteSpeed/Apache request timeout (proxy — usually 300 seconds on cPanel). On top of that, phpMyAdmin itself has $cfg['ExecTimeLimit'] which it tries to enforce inside the PHP script.
Even when all of those are raised generously, you also need MySQL to accept the resulting max_allowed_packet if the dump contains rows over 16MB. And the browser has its own opinions about how long an HTTP upload can stall before the user reloads the tab — which restarts the import from the beginning and creates duplicate-key errors for whatever already landed.
How to verify
For an account acmecorp on the cPanel server:
php --ini | grep -i "loaded\|cli\|user\|directory"
grep -E "upload_max_filesize|post_max_size|max_execution_time|max_input_time" /home/acmecorp/public_html/.htaccess
mysql -e "SHOW VARIABLES LIKE 'max_allowed_packet'"
ls -lh /home/acmecorp/dump.sql.gz
Confirm which PHP php.ini the user’s cPanel account loads (cPanel’s MultiPHP can give every account a different one). The .htaccess overrides are what phpMyAdmin sees at runtime. max_allowed_packet lives in MySQL config and the import fails opaquely if a single row exceeds it.
The fix
- Skip phpMyAdmin entirely for anything over 100MB. SSH to the account:
mysql -u acmecorp_wp -p acmecorp_wp < dump.sql. If the dump is gzipped:zcat dump.sql.gz | mysql -u acmecorp_wp -p acmecorp_wp. This bypasses every PHP and proxy timeout, and the only constraint ismax_allowed_packet, which you can set per-session:mysql --max_allowed_packet=512M .... - For accounts without SSH, use phpMyAdmin’s UploadDir. Drop the SQL file in
/home/acmecorp/cpanel_phpmyadmin_upload/(cPanel reads from this path by default), then in phpMyAdmin > Import, the file appears in a dropdown. The upload happens out-of-band over SFTP, and only the import runs through PHP — much faster. - Raise the right limits when SSH and UploadDir are both off the table: edit the account’s PHP via MultiPHP INI Editor —
upload_max_filesize = 512M,post_max_size = 512M,max_execution_time = 1800,max_input_time = 1800. Then in WHM > Service Configuration > Apache or LiteSpeed, raise the proxy timeout to match. Restart the web server. The import will still be slower than CLI because every row goes through PHP. - Always disable foreign key checks and autocommit for big imports:
SET autocommit=0; SET unique_checks=0; SET foreign_key_checks=0;at the top of the dump,COMMIT;at the bottom. A 400MB dump that takes 40 minutes with default settings can finish in 4 with these — InnoDB stops flushing after every row. - If the import fails halfway, do not re-run the whole dump. Find the last statement that succeeded with
SHOW TABLE STATUS, truncate any partially-loaded tables, and resume. Or accept the cost andDROP DATABASE+ re-import — the second approach is faster in practice for a one-shot migration.
For accounts whose dumps consistently outgrow what phpMyAdmin can carry, Stack Harbor’s WHM server management team builds the SSH + CLI workflow into onboarding so nobody has to argue with the upload form at 11pm.