How to overcome the default import 2MB limit in SQL with phpMyAdmin.
Start with your development environment:
In case you run it on Windows (Windows Web Development Environment with Windows, Apache, MySQL, and PHP) it can be found in C:\Program Files\PHP5 or under an alternate name with the PHP version attached i.e. \bin\php\php5.5.12\.
For LAMP, which is the short name for open-source software: Linux operating system, Apache HTTP server, MySQL database and PHP programming language.
With Apache2 and PHP5 installed you need to make three changes in the file
sudo gedit /etc/php5/apache2/php.ini
If you run XAMPP, then probably you will find the php.ini file in the .xamppapachebinphp.ini file.
Let’s see the steps required:
1. Search for the entry
post_max_size = 2M
2. Insert a larger number than the size of your database (i.e. if you have an 8MB database in this case you can increase it to 64M
3. Edit the
4. Give a larger number than the one given to
post_max_size i.e. if you insert 64M to post_max_size; you need to enter a higher figure to the memory_limit i.e. 128M.
5. Edit the entry
upload_max_filesize with a value smaller than the
post_max_size i.e. 64M or less.
In summary, starting from bigger values the order should go like this
– post_max_size > db size
– memory_limit > post_max_size
*This post is intended to help users import their databases into local installations. In web hosting, things differ from host to host. A good practice is to check your phpMyAdmin limit (on my Namecheap web host shared server the PHPMyAdmin limit is set to 50MB) located in your phpMyAdmin and selecting the tab Import. If your database is larger than the limit of your web host, you should message them for arrangements.