Home >Database >Mysql Tutorial >How Do I Increase the Import File Size Limit in PHPMyAdmin?

How Do I Increase the Import File Size Limit in PHPMyAdmin?

Susan Sarandon
Susan SarandonOriginal
2024-12-04 20:22:17740browse

How Do I Increase the Import File Size Limit in PHPMyAdmin?

Understanding Import File Size Limits in PHPMyAdmin

PHPMyAdmin imposes an import file size limit, preventing the import of large-sized databases. Despite modifying the traditional PHP.INI parameters, such as upload_max_filesize and post_max_size, users may encounter a persistent 2MB limit.

To resolve this issue, it is essential to modify the php.ini file located on the server and make specific adjustments within the file.

  1. Locate the php.ini File:

    • For Apache2 and PHP5:

      sudo gedit /etc/php5/apache2/php.ini
    • For Apache2 and PHP7.0:

      sudo gedit /etc/php/7.0/apache2/php.ini
  2. Adjust Parameters:

    • post_max_size: Set this value greater than the size of the database you want to import (e.g., 25M).
    • memory_limit: Set this value higher than the post_max_size (e.g., 30M).
    • upload_max_filesize: Set this value to be smaller than post_max_size (e.g., 20M).

    The correct order from largest to smallest should be:

    memory_limit
    post_max_size
    upload_max_filesize
  3. Restart Apache:

    • Save the modified php.ini file.
    • Restart Apache using the following command:

      sudo /etc/init.d/apache2 restart

Once the changes are applied and Apache is restarted, you should be able to import files larger than 2MB using PHPMyAdmin. Remember, it is important to ensure the file size is within the specified limits.

The above is the detailed content of How Do I Increase the Import File Size Limit in PHPMyAdmin?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn