Are you trying to upload a database to your site, but it’s getting rejected by phpmyadmin? That’s a common issue, but unfortunately it can happen under a number of circumstances and there are many places where the file size restriction can live, making the issue difficult (or at least tedious) to troubleshoot.
Recently this happened to me when trying to install a 200MB database onto a local installation of WordPress, using MAMP for the heavy lifting. My localhost setup would have no issues with a database of this size but phpmyadmin rejected it every time. I wanted to get my local environment set to match the production version, so this was a necessary step.
If you are seeing this error, you have the same issue:
You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.
So the hard part here is finding out where the limit exists. Is it your PHP configuration? It is phpmyadmin itself? It’s not immediately clear, and phpmyadmin is of no help — there is no setting concerning maximum file size for imports and the documentation that the error links to is not helpful.
The first thing try, especially if you are using MAMP + Windows on your local is:
$cfg['UploadDir'] = '';
''
so that you have $cfg['UploadDir'] = 'uploadFolder';
This is essentially the fix that the phpmyadmin FAQ docs recommend if you are seeing that error or timeouts.
Now try to select the file from the newly-created dropdown in the phpmyadmin Import tool. The old method, of choosing any file you want will be there, but this new uploadFolder directory shortcut should work.
Did that get around the file size limit? Great! If not then the restriction lives elsewhere. This isn’t quite as easy to fix, but it’s not hard. We’ll fix things through the PHP file size limit. This requires messing with your PHP config files, so type carefully.
.../phpmyadmin[version#]/config.inc.php
. More specifically you are probably looking for Applications/MAMP/bin/php/php5.4.10/conf/php.ini
upload_max_filesize
and post_max_size
to appropriate sizes so you can complete your upload. You might need to increase the memory_limit
as well, depending on just how big the file it.max_execution_time
and max_input_time
Between these two methods you should be all set. If not, there are still other settings you might want to look at, but they will get increasingly specific based on your situation. For instance, if you are not on a local setup with MAMP, but rather a server with CPanel then that app has its own “Tweak” setting called “cPanel PHP Max POST size.” You can increase that in order to import a larger database.
Sal February 5th, 2018
Posted In: Localhost / Environment
Tags: Databases, MAMP, phpmyadmin