phpMyAdmin import file size 2M limit phpMyAdmin import file size 2M limit nginx nginx

phpMyAdmin import file size 2M limit


I checked with my DigitalOcean technical support and found out the reason: I restarted Nginx, but haven't restarted php-fpm which is the PHP process for Nginx.

After I tried service php7.0-fpm restart, phpMyAdmin is showing (Max: 150MiB) for importing limit now. And the importing works!


You must change the mysql server settings too my.ini or my.cnf file by including the single line under [mysqld] section:

max_allowed_packet=500M

Then restart the MySQL server. In case of 500M is not enough use another value.


In my case, after a long search, I found a new world for me which saves too much time and effort (i.e SSH)

Uploading via SCP then importing via SSH.

Advanages:

1- Very fast comparing to the tradional method.

2- No size limit and no need to edit any files.

Disadvantages:

Nothing but the fact that it is not visual process so it needs typing some commands, It will take you sometime to get familiar with it, you might need to keep searching for a while but honestly at the end you will know it is worth it.

  • So, first upload the db file somewhere in your server (Doesn't really matter where to upload it).

    scp path to/your file.sql user@server:/path-to-save-the-file (enter password when prompt) (capnel user, appears at the top of your cpanel file manager e.g home3/user/public_html/..)

Please note the following points:

a. in some cases you will need a ssh key so look it up if that's your case.b. If you are uploading folder and its content you need to add -r flag(i.e. scp -r    ).c. in my case i was uploading to aws cloud so -i flag is required in this case.
  • Now, connect to your server via ssh (I have windows 10 machine, so from powershell, bash or cmd)

    ssh user@server (enter password when prompt)

in my case for aws it was was ( ssh -i key.pem ec2-user@Public IPv4 DNS )

cd /path-where-you- have-saved-the-file

then..

mysql -u username -p databsename < your-file.sql (replace username and database name) (enter db user password when prompt).