I am using https://github.com/sameersbn/docker-mysql to run the mysql container using docker-machine in OSX using a virtual box.
I created a new car
docker-machine create
IP address
docker-machine ip mytest 192.168.99.103
I start the container as follows:
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 mysql in a container from my host machine, I can connect using the sampleuser user, but not as the 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 - my local laptop IP address
โถ ifconfig | grep "192" inet 192.168.99.1 netmask 0xffffff00 broadcast 192.168.99.255
source share