Increase phpMyAdmin Import File Size Limit

Publish: 2014-12-03 | Modify: 2014-12-03

The website has been under construction for a long time, and the database has naturally grown. Sometimes, when we are moving, we find that the database import exceeds the limit of phpMyAdmin itself and cannot be imported directly. However, we can modify the size limit of the phpMyAdmin import file to achieve it.

When the size of the database imported by phpMyAdmin is larger than 2M, the following prompt will appear: "No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16."

一、Modify the php.ini file

  1. Find post_max_size, which is the maximum value that PHP can receive through the form POST, including all values in the form. The default is 8M, you can change it according to your needs.
  2. Find File Uploads, first confirm if file_uploads = on allows uploading files via HTTP. The default is ON, which means it is enabled. upload_tmp_dir
  3. Find upload_max_filesize, which is the maximum value allowed for uploading file size. The default is 2M.
  4. If you want to upload a file larger than 8M, it may not be enough to only set the above four items. It is best to set the following parameters as well: Find max_execution_time = 600, which is the maximum time value (in seconds) for each PHP page to run. The default is 30 seconds. Find max_input_time = 600, which is the maximum time required for each PHP page to receive data. The default is 60 seconds. Find memory_limit = 8M, which is the maximum memory consumed by each PHP page. The default is 8M.

二、Modify the import.php file of phpMyAdmin

  • Find $memory_limit, which is set to $memory_limit = 2 * 1024 * 1024;, you can modify it yourself.
  • The same statement can be found in the next three or four lines, you can modify it yourself.

However, I directly followed the method in step one to modify it, and I was able to exceed the default upload size without performing the operations in step two. You can set it according to your own situation. In addition, virtual host users cannot modify these files. If the database file is too large, you can only export a single table.


Comments