I have a 2 docker setup – one container with a MysqlDB on it and another with a web server. Both are on the same machine.
The db container has it 3306 port exposed though the hosts 3306 port (argument -p 3306:3306). This container is reachable (I can log into the mysql database) both through the host machine and outside, but for some reason, the web server container fails to connect to it.
I have ssh on the container with the web server. When I run:
nmap -p 3306 host.machine.ip.address
on it, I get:
PORT STATE SERVICE 3306/tcp filtered mysql
and when I actually try to log in I get:
mysql -h host.machine.ip.address -u root -p Enter password: ERROR 2003 (HY000): Can't connect to MySQL server on 'host.machine.ip.address' (113)
Can somebody point me to where the issue might be?