How do you connect to your local machine’s instance of MySQL?
In this example, we’re doing dev coding on our local machine while running the container.
The container thinks localhost or 127.0.0.1 is itself.
So, simply use “host.docker.internal”, which will map to your local machine’s IP address.
If you’re using a variable in a .env file, it would something like
Don’t forget to give MySQL permissions to that user to connect from a remote host.