Ubuntu: Change the File Size Limit for phpMyAdmin SQL Dump Imports

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.

Nifty.

You might also enjoy:

About Craig Lotter

Craig Lotter is an established web developer and application programmer, with strong creative urges (which keep bursting out at the most inopportune moments) and a seemingly insatiable need to love all things animated. Living in the beautiful coastal town of Gordon's Bay in South Africa, he games, develops, takes in animated fare, trains under the Funakoshi karate style and for the most part, simply enjoys life with his amazing wife and daughter. Oh, and he draws ever now and then too.
This entry was posted in Tutorials and tagged , , , , , , . Bookmark the permalink.

Comments are closed.