[How To] Increase import file size in PHPMyAdmin

By default when you want to import sql file size is 2MB in PHPMyAdmin. That is PHP’s file upload limit. To change maximum import file size do following steps.

Table of Contents

Step 1: Find php.ini file

The first step to increase the import file size in PHPMyAdmin is to find the php.ini file. To do this, open a terminal window and type the following command:

$ locate php.ini
/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini
/usr/share/doc/php5-common/examples/php.ini-development
/usr/share/php5/php.ini-production
/usr/share/php5/php.ini-production-dist
/usr/share/php5/php.ini-production.cli
/var/www/php.ini
root@LC-VM:/home/lc-root#

This will give you a list of all the php.ini files on your system.

Step 2: Edit php.ini file

Once you have found the php.ini file, you can open it in a text editor to make changes. To do this, type the following command in a terminal window:

$ vim /etc/php5/apache2/php.ini

This will open the php.ini file in the Vim text editor.

Step 3: Change values

Next, you need to change the values of the following variables in the php.ini file:

post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M

The specific values you use will depend on your own needs. It is recommended that you set the post_max_size and upload_max_filesize values to the same number to prevent any potential issues.

Step 4: Restart apache

Once you have changed the values in the php.ini file, you need to restart Apache for the changes to take effect. To do this, type the following command in a terminal window:

$ service apache restart

In this example we used Ubuntu 11.10

Conclusion

Increasing the import file size in PHPMyAdmin is a fairly straightforward process. Find the php.ini file, edit it, change the values, and restart apache. Once the changes have been made, the new maximum file size will be applied to all import operations made in PHPMyAdmin. This is especially useful for larger databases that you may want to import into the system. Additionally, you can use the same process to increase the upload file size limit for other applications as well.

6 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.