phpmyadmin / docker

Docker container for phpMyAdmin
https://hub.docker.com/_/phpmyadmin
GNU General Public License v3.0
665 stars 456 forks source link

During database import I have occur this error how to solve it. #386

Closed qamarabbas572 closed 1 year ago

qamarabbas572 commented 1 year ago

Warning: POST Content-Length of 3699863 bytes exceeds the limit of 2097152 bytes in Unknown on line 0

I am creating container like this docker run --name phpmyadmin --network sugarnetwork --ip 172.16.0.21 --network-alias phpmyadmin -d -e PMA_ARBITRARY=1 -e 'post_max_size:3699985' -e 'upload_max_filesize:5000m' -p 8080:80 qamar572/phpmyadmin

ibennetch commented 1 year ago

Usually that error message comes from trying to upload a file that is too big for the resource limits imposed by the webserver.

There are a few workarounds you can try, in this case using the UploadDir feature or importing from the command-line client might be good options. I believe the MariaDB and MySQL Docker images will automatically import files from docker-entrypoint-initdb.d when recreating the image or you can run an import afterwards. See https://stackoverflow.com/q/43880026/2385479 for a discussion on the various options.

Since you're working with Docker, I think one of those options is going to be better than using phpMyAdmin for the import in this case.

williamdes commented 1 year ago

Hi !

I am not sure where you did see this ENV vars and this syntax. The correct line is:

-docker run --name phpmyadmin --network sugarnetwork --ip 172.16.0.21 --network-alias phpmyadmin -d -e PMA_ARBITRARY=1 -e 'post_max_size:3699985' -e 'upload_max_filesize:5000m' -p 8080:80 qamar572/phpmyadmin
+docker run --name phpmyadmin --network sugarnetwork --ip 172.16.0.21 --network-alias phpmyadmin -d -e PMA_ARBITRARY=1 -e 'UPLOAD_LIMIT=5G' -p 8080:80 qamar572/phpmyadmin

You need to use UPLOAD_LIMIT: https://docs.phpmyadmin.net/en/latest/setup.html?highlight=UPLOAD_LIMIT#envvar-UPLOAD_LIMIT See: https://hub.docker.com/_/phpmyadmin

Let me know if it works better

qamarabbas572 commented 1 year ago

HI Williamdes, The issue is fixed thanks a lot.

williamdes commented 1 year ago

HI Williamdes, The issue is fixed thanks a lot.

Very cool, why are you using another image than phpmyadmin:latest?