I pulled MySQL container from Dockerhub and it is running on my macbook pro as you can see as follow
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 12cd3deaa3f0 mysql:latest "/entrypoint.sh mysql" 47 hours ago Up 10 minutes 3306/tcp mysqldb
Then I downloaded the MySQL workbench and I tried to connect it with MySQL container, but it does not work. It shows connection error.
Your connection attempt failed for user 'root' from your host to server at 192.168.99.102:3306: Can't connect to MySQL server on '192.168.99.102' (60)
The IP from docker machine is
docker-machine ip default 192.168.99.100
and the port from MySQL is 3306 as you can see above.
To export MySQL port, I tried with the statement
docker run -d -P mysql:latest mysqldb
It does not work at all. What am I doing wrong?