user2849678 user2849678 - 3 years ago 270
MySQL Question

How to connect to MySQL server on localhost from inside of a Docker container in a windows machine?

I have seen the other ticket on Linux. My issue is on Windows.

I want my Java code running inside a Container to connect to MySQL on

OR i.e.

I am able to connect to MySQL with either
, from the host, but not from within the container.

I've also tried the network option which is

Answer Source

You can use this hostname to connect from within a container to services running on the host:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download