elfensky
elfensky
PPrisma
Created by elfensky on 12/22/2024 in #help-and-questions
How do I connect to mysql on host from inside a docker container?
things I've done: - I changed the bind-address to 0.0.0.0 so mysql would allow connetions from the docker network instead of limiting itself to 127.0.0.1 - To my docker-compose.yml, I added
extra_hosts:
- "host.docker.internal:host-gateway"
extra_hosts:
- "host.docker.internal:host-gateway"
- I changed my db_url string to use internal string instead of localhost. DATABASE_URL="mysql://user:[email protected]/db_name" from what I know that should be enough, but I can't make a connection. telnet host.docker.internal 3306 doesn't seem to work either. What am I missing here? Container works fine if I use host networking, so it's not the password being wrong or prisma being misconfigured - seems to be a networking issue.
7 replies