We are running a mysql container on a VM(192.168.12.86).
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e50 mysql:5.7.22 "docker-entr" 8 hours ago Up 8 hours 0.0.0.0:3306->3306/tcp dev-mysql
We wants to connect that mysql container via traefik. We are running traefik on a separate VM (192.168.12.81).
In our traefik.toml -
defaultEntryPoints = ["http", "https"]
[entryPoints]
[entryPoints.mysql]
address = ":3306"
And on dynamic.toml -
[tcp]
[tcp.routers]
[tcp.routers.to-database]
entryPoints = ["mysql"]
rule = "HostSNI(`*`)"
service = "database"
[tcp.services]
[tcp.services.database.loadBalancer]
[[tcp.services.database.loadBalancer.servers]]
address = "192.168.12.86:3306"
But we couldn't connect mysql server. Getting this error -
2013 - Lost connection to MySQL server at 'waiting for initial communication packet', system error: 110 "Connection timed out"