[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
- Step 2: Edit php.ini file
- Step 3: Change values
- Step 4: Restart apache
- Conclusion
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.
use “getid” in place of “vim”
Hi Gev, great to see another Armenian posting on here. Also we should mention if you increase the upload_max_filesize say above 8mb then you need to also increase the post_max_size to be greater than 8mb or else it caps you at 8mb.
is this for Ubuntu too?
Thanks for sharing. ‘max_execution_time’ nice, finally found it.
while moving my website q4interview.com from godaddy to google cloud, i encountered with error related to db import. my db size was 400MB, and php admin was allowing only 2k. By following these steps i was able to upload my db.
Thanks to all bellow information, I was trying to solve to increase uploat size but befor this blog, i am not able to solve after your blog finaly I acheave this.
post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M