I'm using https://github.com/sameersbn/docker-mysql to run a mysql container using docker-machine
in OSX with virtualbox.
I created a new machine
docker-machine create --driver virtualbox mytest
The IP is
docker-machine ip mytest
192.168.99.103
I run the container like this:
docker run -p 3306:3306 --name mysql -d \
-v /opt/mysql/data:/var/lib/mysql \
-e 'DB_USER=sampleuser' -e 'DB_PASS=samplepass' -e 'DB_NAME=sampledb' -e 'DB_REMOTE_ROOT_NAME=root' -e 'DB_REMOTE_ROOT_PASS=samplerootpass' \
sameersbn/mysql:latest
Now, when I try to connect to the mysql in the container from my hostmachine I can connect using user sampleuser
but not as user root
.
▶ mysql -u root -p -h 192.168.99.103
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'192.168.99.1' (using password: YES)
192.168.99.1
is my local laptops ip address
▶ ifconfig | grep "192"
inet 192.168.99.1 netmask 0xffffff00 broadcast 192.168.99.255