phpMyAdmin Import Limit Exceeded: Real Fix
That 'import limit exceeded' message means your PHP settings can't handle the file size. Here's how to fix it without guesswork.
You're in phpMyAdmin, trying to import a SQL backup file you dumped from your old host. The file is maybe 50MB — not huge by modern standards. You click 'Go', the progress bar creeps along, then stops dead. You get a white page or the error Error 2006: MySQL server has gone away. Or maybe you see a popup saying ‘Probably the maximum upload size limit has been exceeded’.
This happens every time with files above the default 2MB limit. It's not a database corruption issue. It's not a network problem. It's PHP limiting how much data it will accept in a single upload. The fix is straightforward, but you need to find the right file to edit.
Why phpMyAdmin Rejects Big Files
phpMyAdmin runs on a web server with PHP. PHP has three settings that control imports:
- upload_max_filesize – the largest file the server will accept in any upload form. Default is 2MB.
- post_max_size – the largest total POST data the server will accept. Must be bigger than upload_max_filesize.
- max_execution_time – how many seconds PHP can run before it stops. Large imports take time, so this number needs to be high (like 300–600 seconds).
If any of these three values is too small for your SQL file, the import fails. The real root cause: the PHP handler on your server is configured with conservative defaults. Shared hosting is especially bad — they often lock these values low to protect other customers.
Step-by-Step Fix
Step 1: Check your current PHP limits
Before changing anything, find out where you stand. Create a file called info.php with this content:
<?php phpinfo(); ?>
Upload it to your server's web root (usually public_html or www), then open it in your browser: https://yoursite.com/info.php. Look for these values under the Core section:
- upload_max_filesize
- post_max_size
- max_execution_time
- max_input_time
Write them down. After you apply the fix, come back here to check they changed. Delete info.php when you're done — it's a security risk to leave it online.
Step 2: Edit php.ini (if you have access)
Most shared hosts let you create a php.ini file in your web root. Use a plain text editor (Notepad++, VS Code, or even the built-in cPanel File Manager editor). Create or edit php.ini with these lines:
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 600
max_input_time = 600
memory_limit = 256M
Save the file, then refresh the info.php page. You should see the new values. If you still see the old defaults, your host may not allow php.ini overrides. Move to Step 3.
Step 3: Use .htaccess (if you're on Apache)
If Step 2 didn't work, try adding these lines to your .htaccess file (in the same folder as phpMyAdmin or your site root):
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 600
php_value max_input_time 600
Save and check info.php again. If the values still haven't changed, your host has disabled PHP value overrides in .htaccess. That's common on budget hosts. Go to Step 4.
Step 4: Use cPanel's MultiPHP INI Editor
If your host uses cPanel (most do), look for MultiPHP INI Editor in the Software section. Select your domain, and you'll see a form where you can change the same values. Set them to 128M or higher. This is the most reliable method on shared hosting because it bypasses file-level overrides.
After saving, check info.php to confirm. The values should update immediately.
Step 5: Split your SQL file
Sometimes no matter what you do, the host won't let you increase limits beyond 10M or 20M. In that case, break your SQL file into smaller chunks. Use a tool like BigDump (free script that reads SQL files line by line) or split the file manually in a text editor. Look for INSERT INTO statements – split between them. Import each chunk separately.
Also check if your host provides phpMyAdmin's 'compression' option on the import page. Choose 'gzipped' and upload a .gz version of your SQL file. The actual data is smaller, but more importantly, phpMyAdmin decompresses it on the server side, which sometimes bypasses the upload limit.
What to Check If It Still Fails
If you've raised all limits and the import still fails, here's what's likely wrong:
- Timeout during execution. Your phpMyAdmin session expired. Log back in and try again. Some hosts have a global PHP execution limit that can't be overridden at the user level.
- MySQL packet size. In rare cases, MySQL also limits the size of individual SQL statements. Edit
my.cnfand setmax_allowed_packet = 128M. Restart MySQL. On shared hosting, you can't do this — split the file more aggressively. - Browser timeout. If you're on a slow connection, the browser itself may time out. Use a local tool like MySQL Workbench or the command line
mysql -u username -p database_name < file.sqlinstead. That bypasses all PHP limits entirely. - False positives from security plugins. Wordfence or ModSecurity can block large POST requests. Disable them temporarily during the import, then re-enable.
The command-line method is the real fix if you keep hitting walls with phpMyAdmin. It's faster, it doesn't have upload limits, and it gives you visible progress output. If you can SSH into your server, use that. If you can't, ask your host to run the import for you — most will do it if you ask nicely.
Was this solution helpful?