Answer the question
In order to leave comments, you need to log in
Why can't I access mysql docker container?
There is a problem with connecting to a running docker container with mysql from the host machine. That is, if you enter the container itself and use mysql inside, then everything is OK, it works. Problem with connecting from a computer (host) via datagrip. No matter what I tried, it doesn't work. Ports are open, mapped. I'm on mac. Who can tell what is the problem?
DOCKERFILE:
FROM alpine:latest
WORKDIR /app
#VOLUME /app
COPY startup.sh /startup.sh
COPY backup.sql /app/
RUN apk add --update mysql mysql-client && rm -f /var/cache/apk/*
COPY my.cnf /etc/mysql/my.cnf
EXPOSE 3306
docker run -t -i -d -p 3306:3306 --name mysql mysql
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5fb9d4b9fa99 mysql "/startup.sh" 7 seconds ago Up 6 seconds 0.0.0.0:3306->3306/tcp mysql
192.168.99.100:3306
хост - 192.168.99.100
порт - 3306
юзр - root
пароль - pass
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question