21

I am not able to change the file size that phpmyadmin accepts for importing databases on my test server.

I have changed all values I have some idea about in my.cnf:

max_packet_size
Key_buffer

or the upload file size and max_post_size value in every php.ini file I have found on the system.

The accepted file size on the import screen still remains 8,192kib.

1

5 Answers 5

36

To increase MySQL phpmyadmin import file size in Ubuntu 16.04 or newer, follow these steps. In the newest Ubuntu version you can have either PHP 5 or PHP 7.

Step - 1: open php.ini of the appropriate PHP version(s).

  • For PHP v5.0

    sudo -H gedit /etc/php5/apache2/php.ini
    
  • For PHP v7.0

    sudo -H gedit /etc/php/7.0/apache2/php.ini
    
  • For PHP v7.1

    sudo -H gedit /etc/php/7.1/apache2/php.ini
    
  • For PHP v7.2

    sudo -H gedit /etc/php/7.2/apache2/php.ini
    
  • For PHP v7.3

    sudo -H gedit /etc/php/7.3/apache2/php.ini
    

Step - 2: Now need to increase below parameters in the php.ini file.

memory_limit = 1500M

post_max_size = 1500M

upload_max_filesize = 1500M

Please Note : post_max_size should be larger than upload_max_size

Step - 3: Now you need to restart your apache server to effect changes.

sudo service apache2 restart
1
  • Someone else tried to leave this as a comment in response to this answer: "Note it is actually mentioned above but when I inserted 1500Mb it didn't worked.My localhost got out of the order. It should 1500m not 1500mb ;)" Nov 8, 2018 at 15:34
8

The first things to check (or ask your host provider to check) are the values of max_execution_time, upload_max_filesize, memory_limit and post_max_size in the php.ini configuration file. All of these three settings limit the maximum size of data that can be submitted and handled by PHP.

Please note that post_max_size needs to be larger than upload_max_filesize.

7
  1. create info.php page and check all details about file

    <?php 
      phpinfo();
    ?>
    
  2. run in your browser search upload_max_filesize and post_max_size change by default value 2M to 80M.

  3. Run

    sudo -H gedit /etc/php5/apache2/php.ini
    
  4. change both values upload_max_filesize and post_max_size
    change by default value 2M to 80M

  5. Restart apache

    sudo /etc/init.d/apache2 restart
    
3

Set the variables upload_max_filesize, post_max_size, memory_limit in php.ini to the right values and restart the server, then it should work.
If it does not work, check with phpinfo() if you edited the right php.ini.

0

If In case you are using Virtualmin , Webmin or Usermin then

Follow below 2 steps as per image: 1. step 1 image

2. step 1 image

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .