Skip to content

Connecting to a mysql running on a Docker container #95

@dzlab

Description

@dzlab

I'm trying to run mysql server on a Docker (installed with Docker Toolbox for Mac) container and access it from my machine running OS X Yosemite. The documentation from the official repo does not explain how to connect from outside the docker host !!

I've created a container using the official repository as follows:

$ docker pull mysql
$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest -p 3306:3306 
$ docker-machine ip default
192.168.99.100
$ docker inspect CONTAINER_ID

Then I get the ip address (172.17.0.1), but when I ping it I see time outs!!!
I tried to add port forward to the default machine:

VBoxManage controlvm "default" natpf1 "tcp-port3306,tcp,,3306,,3306";

But when connecting with Sequel pro (a mysql client) with root@192.168.99.100 on 3306, I have a connection failure.

What's the appropriate way to connect to the running mysql server?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions