Connection to a containerized MySQL installation

Hi team,

I have an ubuntu server with a MySQL installation that i want to admin with Nocodb. This Nocodb installation is on another docker container, but when I try to access the MySQL db from Nocodb, is throwing Error timed out. I have exposed the port from the container and in the firewall port 3306 its open, is there any further steps that I’m missing?

I assume this is more of docker networking related question than nocodb. there are two ways to achieve this, confirm which path have you taken

  1. docker network : create docker network and launch both instances in that network, then both containers can interact by their container names directly
  2. connect via host network : your mysql db should have a port mapping (expose instruction in DockerFile wont be enough). You should pass an extra argument in docker run command of mysql —add-host=host.docker.internal:host-gateway so you can access the port mapped container through your hosts ip address.

hope this helps.

1 Like

Thanks so much for your help, it worked, I created a new docker network and connected both containers there.