1

The Docker run command is:

docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=flurpgraSS -d mysql:5.7

Docker Desktop shows the container: enter image description here I can access the server from the CLI launched by Docker Desktop and the root account appears to be OK: enter image description here

I can't access the server using MySQL Workbench enter image description here

1
  • Could you show us docker run command? Commented Apr 25, 2022 at 14:36

1 Answer 1

2

We might need to expose port from docker by -p parameter, otherwise, we can't access it outside.

docker run --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=Danger42! -d mysql:5.7

There is some description from Container networking

-p 3306:3306:Map TCP port 3306 in the container to port 3306 on the Docker host.

Sign up to request clarification or add additional context in comments.

4 Comments

When I start the image I get this error "Error invoking remote method 'docker-start-container': Error: (HTTP code 500) server error - Ports are not available: listen tcp 0.0.0.0:3306: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."
@nicomp The port of 3306 might be used from your host computer
There is another sample, we can change the left of port parameter ex: -p 5555:3306 we can connect the MySQL container by 5555 from your host
That was the problem. The service was already running on the desktop. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.