phpmyadmin logoWorking with the web-based phpMyAdmin can sometimes be a bit of a lesson in frustration, particularly when you start bumping your head against its various limitations. One such annoying limit is the default 2MB upload limit applied for SQL file imports.

The good news is that this limit is actually not a hard and fast part of phpMyAdmin any more – and changing it to something a bit larger to handle those bigger databases is pretty simple to achieve!

So let’s get started then.

The size limitation is actually controlled by the PHP implementation powering the web server that is dishing up the phpMyAdmin portal, meaning that changing the default limits imposed by the PHP configuration will in turn adjust the limits imposed by phpMyAdmin.

The first step is thus to open up the php.ini configuration file for editing.

gksudo gedit /etc/php5/apache2/php.ini

Once open, search for the following three settings and adjust them accordingly to suit your upload needs – e.g. change 2M to 16M.

  • upload_max_filesize
  • post_max_size
  • memory_limit

Save the changes made to your php.ini file and then reload Apache’s privileges (i.e restart the webserver):

sudo /etc/init.d/apache2 reload

And that is that. Reload the phpMyAdmin import page and you will see that the limit has now changed to what you have set it to be in the php.ini file.