I am trying to connect to mysql database from docker image. However it's throwing errors.
following is the docker image I am using. https://hub.docker.com/_/mysql/
And following is the command I have used to run the docker image.
docker run -p 3306:3306 --name mysql_80 -e MYSQL_ROOT_PASSWORD=password -d mysql:8
Following is the output of docker ps
command
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9f35d2e39476 mysql:8 "docker-entrypoint.s…" 5 minutes ago Up 5 minutes 0.0.0.0:3306->3306/tcp
if I check the IP using docker inspect and ping that IP, it shows IP is not reachable.
docker inspect 9f35d2e39476 | grep -i ipaddress
And if i try to connect using localhost
and 127.0.0.1
I am getting following error.
question from:https://stackoverflow.com/questions/49019652/not-able-to-connect-to-mysql-docker-from-localUnable to load authentication plugin 'caching_sha2_password'.