Content
PhpMyAdmin restriction on the size of the uploaded file
PhpMyAdmin Limitation on Upload File Size
PhpMyAdmin is a widely used tool to manage MySQL databases, but it comes with a limitation on the upload file size. The maximum file size that can be uploaded through PhpMyAdmin is typically limited to 2MB. If you try to upload a file that exceeds this limit, you will receive an error message.
The limit on upload file size in PhpMyAdmin is in place to prevent malicious activities and potential security breaches. By limiting the maximum file size, PhpMyAdmin ensures that no one can upload files that could potentially compromise the server's security.
However, there are certain situations where you may need to import a large database from sql-dump using PhpMyAdmin. In such cases, exceeding the upload file size limit can pose a problem.
How to import a large database using PhpMyAdmin & steps:
These actions are necessary if you need to import a large database from a SQL dump using PHPMyAdmin. With such an import, the following error may appear:
Error: Your database has exceeded its memory limit
There is a problem with the file size because it exceeds the limit set by the PHP parameters. Therefore, these parameters need to be changed. Two options are required, upload_max_filesize and post_max_size. The first specifies the maximum file size for uploading, and the second specifies the maximum file size for POST requests (by this method, PHP saves the file). The record data can be found in the php.ini file.
The following command can be used to locate its location.
# php -i | grep php.ini Configuration File (php.ini) Path => /etc Loaded Configuration File => /etc/php.ini
Alternatively, you can simply perform a search for a file containing this parameter:
# grep -iRI upload_max_filesize /etc/ /etc/php.ini:upload_max_filesize = 2M
After the file is found, you should open it with any convenient text editor, find the indicated variables and change their values, as required by your uploaded file.
upload_max_filesize = 60M post_max_size = 60M
For this example, the test file is approximately 50 MB, so 60 MB is selected. In the following step, we restart the service that processes PHP (in this case, apache, possibly php-fpm instead).
# service httpd restart
After restarting, we return to the Import menu and see that the maximum size of the uploaded file has been changed.
Congrats! Your upload limit has been increased in PHPMyAdmin (and WordPress, if you use it too).
Conclusion
In conclusion, you now know how to increase the PHPmyadmin import file size. By following these steps, you can easily solve this problem yourself, without having to hire someone from Fiverr or Upwork. Increasing the upload limit in WordPress is now within your reach, so go ahead and give it a try.