I have a Ubuntu machine with IP = 172.16.12.134. On this Ubuntu machine, I have a docker instance of MySQL image running. The IP address of docker instance is like 172.18.0.8.
I am able to access db from ubuntu machine terminal with command like mysql -h 172.18.0.8 -P 3306 -u root -p.
Is there a way to access the db from outside(any other machine)the ubuntu machine?
like mysql -h 172.16.12.134 -P 3306 -u root -p.
I exported the port of docker in yml file as -port 3306:3306.