Unable to connect to remote MySQL from a docker on Ubuntu Desktop
After much groping in the dark, I think I may have uncovered an
Ubuntu Desktop specific
docker issue. Please take note of the following:
- I work at a large corporation where my laptop is connected to internal network (that houses a remote
MySQLdb). My laptop runs
UbuntuDesktop OS (v14.04).
- I can connect to the remote
mysql -u<username> -p<password> -h<host>) command from my laptop. I can also
MySQLserver on port 3306 (
MySQLserver’s default port).
Now, I have a
docker container running on my laptop where neither of
telnet commands to the said
MySQL server work. I initially thought, this may be due to IP forwarding not enabled, so I uncommented line
/etc/sysctl.conf, but to no avail.
Also, note that I do not encounter the same problem on
Ubuntu server OS (again, to reiterate, I’m running
Ubuntu Desktop OS on my laptop).
I do not encounter the same problems if I run the
docker container on a
Mac machine. So, clearly it is something specific to
Ubuntu Desktop OS.
Also, this cannot be related to
MySQL privileges since I can connect to the
MySQL server from my laptop.
Would anyone know why this is the case?