wp-local-docker-v2: Import of DB with PHPMyAdmin not working
I opened PHPMyAdmin on localhost:8092.
Opened a DB of an environment
Removed all tables.
Tried to import a DB and PHPMyAdmin gives me only this: Incorrect format parameter
I have tried multiple DB backups (sql files), and also compressed (zip files).
[update] It’s probably because of upload limits, so I’ve edited the php.ini file in /usr/local/php with this:
upload_max_filesize = 1000M
post_max_size = 1000M
I see these values in a phpinfo page I created, but PHPMyAdmin still uses 2M as max upload size.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 24 (1 by maintainers)
Hi,
I solved import of DB error, by changing UPLOAD_LIMIT=1G at docker-compose.yml
myadmin: image: phpmyadmin/phpmyadmin container_name: phpmyadmin ports: - “8083:80” environment: - UPLOAD_LIMIT=1G - PMA_ARBITRARY=1 - PMA_HOST=${MYSQL_HOST} restart: always depends_on: - mysqldb
@mbootsman I looked into this a bit. wp-local-docker-v2 utilizes the phpmyadmin/phpmyadmin image. Turns out the latest image of phpmyadmin/phpmyadmin does NOT configure the max upload size in php at all where, at least some, previous images did.
Here is the new image
Here is the old image
For this an issue would need to be raised at https://github.com/phpmyadmin/docker/issues.
However, you have other options. wp-local-docker-v2 does expose mysql on port 3306 so you can use any database management app you might have on your system already. Simply connect to 127.0.0.1 port 3306 and log in as root/password. Your other option to import the database is to put the sql file into the doc root of your project (so wp-local-docker-sites/<project>/wordpress) and use
10updocker wp db import <filename>. This will import the database using wp cli instead of other methods.Hope that helps
10updocker wp db import mysql.sqlshould work as long asmysql.sqlis inside thewordpressfolder. Thanks!Hi @mbootsman. I have the same problem. I found a temporary solution for myself: in
/global/docker-compose.ymlin themysql service, I added myvolumeand mounted it on the/ homefolder.- "./mysqlData/:/home/mysqlData"Put there the database that you need to import. Usingdocker, I connected to theglobal_mysql_1 container$ docker exec -it global_mysql_1 bashand imported the database using the mysql CLI.$ mysql -u root -ppassword is: passwordmysql> use dev-testmysql> source /home/mysqlData/dev-test.sqlI apologize for the English, used Google Translator)))
Thanks @williamdes, I really think the people of this repo should look into this, and at least see if my problem can be reproduced.
By the way: I added
UPLOAD_LIMITENV to the docker image.@mbootsman I think this issue can be closed
https://github.com/phpmyadmin/docker/pull/261
I found a workaround for the size limit. This approach isn’t permanent but it at least lets you raise the limit for the current session to import the database via phpmyadmin.
Use
docker psto find the CONTAINER_ID for phpmyadmin.Run
docker exec -it [CONTAINER_ID] bash, replacing [CONTAINER_ID] with the correct value.From within the container, copy
/usr/local/etc/php/php.ini-productiontophp.iniin the same directory.Use apt to install an editor (i.e. vim or nano)
apt update && apt install vim.Edit the new php.ini file to increase
post_max_sizeandupload_max_filesizeto the desired limits.Run
apache2ctl restartso the new php settings can take effect. This will exit the container.Load localhost:8092 for phpmyadmin and the import limit should now be whatever you set it to.
There’s probably a better or more permanent way to apply this workaround but hey, whatever works.
I understand, that’s why this issue is in the wp-local-docker-v2 repo 😉
Using nginx, and furthermore it’s all just default stuff coming out of the 10updocker configs.