wp-env can’t connect to database
-
NB: this is, if not my first time, then my first time in many years posting here, so apologies if this is in the wrong spot.
I seem to have broken my wp-env environment somehow, and can’t figure out how to diagnose it. This is on MacOS BigSur 11.2.2
$uname -a Darwin cwr-space-grey-macbook-pro-2017.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
I was successfully building and developing plugins with wp-env. Then I tried working on a theme, and in the process of getting that working, I seem to have broken something, and connection to the database is no longer working.
% node -v v14.16.0 % npm -v 6.14.11 % wp-env --version 3.0.2 % npx @wordpress/create-block foo ... Done: block "Foo" bootstrapped in the "foo" folder. % cd foo % wp-env start ? Error while running docker-compose command. Creating e6bc9159b910bda3d9b0dae2e230eabd_cli_run ... done mysqlcheck: Got error: 1130: Host '172.30.0.5' is not allowed to connect to this MariaDB server when trying to connect
Like I said, this was working before, so I broke something, but … I have no idea what or where. The docker containers seem to be up and running:
% ls ~/.wp-env e6bc9159b910bda3d9b0dae2e230eabd $docker volume ls | grep e6bc9159b910bda3d9b0dae2e230eabd local e6bc9159b910bda3d9b0dae2e230eabd_mysql local e6bc9159b910bda3d9b0dae2e230eabd_phpunit-uploads local e6bc9159b910bda3d9b0dae2e230eabd_tests-wordpress local e6bc9159b910bda3d9b0dae2e230eabd_wordpress $docker network ls | grep e6bc9159b910bda3d9b0dae2e230eabd 7d2f51c7f1fa e6bc9159b910bda3d9b0dae2e230eabd_default bridge local $docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 250bb487f0e0 wordpress "docker-entrypoint.s…" 5 minutes ago Up 4 minutes 0.0.0.0:8889->80/tcp e6bc9159b910bda3d9b0dae2e230eabd_tests-wordpress_1 7e385d6b7b21 wordpress "docker-entrypoint.s…" 5 minutes ago Up 4 minutes 0.0.0.0:8888->80/tcp e6bc9159b910bda3d9b0dae2e230eabd_wordpress_1 b10e0260db11 mariadb "docker-entrypoint.s…" 5 minutes ago Up 5 minutes 0.0.0.0:55019->3306/tcp e6bc9159b910bda3d9b0dae2e230eabd_mysql_1 $docker exec -it b10e0260db11 /bin/bash root@b10e0260db11:/# ps auxw USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND mysql 1 0.0 3.9 1345280 79596 ? Ssl 07:37 0:00 mysqld root 59 1.7 0.1 4248 3384 pts/0 Ss 07:42 0:00 /bin/bash root 67 0.0 0.1 5900 2924 pts/0 R+ 07:42 0:00 ps auxw root@b10e0260db11:/#
I tried uninstalling and re-installing wp-env. I tried nuking everything (removed
~/.npm
~/.nvm
~/.wp-env
) and reinstalling. I even tried rolling back to an older wp-env:% wp-env --version 2.1.0
Does anyone have any idea what’s going on here, or what other steps I can take to diagnose it?
Thanks!
- The topic ‘wp-env can’t connect to database’ is closed to new replies.