Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
I'd like to be able to connect to the mysql container from the host (macOS in my case) using the mysql client. To do so, the jetpack_mysql container needs to forward a port. I'm no Docker expert, but I was able to make this work by adding the below to the services > db section of the docker-compose.yml:
ports:
- "${PORT_DB:-3306}:3306"
After brining docker down and back up, I can now connect via:
mysql -h 127.0.0.1 -P 3306 --user="wordpress" --password="wordpress"
In addition to opening the port, you can access mysql via cli by using the yarn docker:db command. The PR to expose the port would help if you have any other DB management tools you'd like to use.
Is your feature request related to a problem? Please describe.
After installing the Jetpack Docker based development environment, I can't connect to the mysql container. The docs here https://github.com/Automattic/jetpack/tree/master/docker#mysql-database suggest it should be possible, however I couldn't figure out how to do it.
Describe the solution you'd like
I'd like to be able to connect to the mysql container from the host (macOS in my case) using the
mysql
client. To do so, thejetpack_mysql
container needs to forward a port. I'm no Docker expert, but I was able to make this work by adding the below to the services > db section of the docker-compose.yml:After brining docker down and back up, I can now connect via:
mysql -h 127.0.0.1 -P 3306 --user="wordpress" --password="wordpress"