-
Notifications
You must be signed in to change notification settings - Fork 13
Home
Siming Yuan edited this page Jul 31, 2020
·
3 revisions
# create a test network
docker network create test
# launch a mysql db
docker run -d --network test --name db -e MYSQL_ROOT_PASSWORD=password mysql/mysql-server:5.6
# attach to it and create user
docker exec -it db /bin/bash
# in container
mysql -p
# password
# create user admin@localhost identified by 'cisco123';
# create user admin@'%' identified by 'cisco123';
# get out of mysql shell and container
# then create a new container on the same network
docker run -it --network test mysql/mysql-server:5.6 /bin/bash
# in shell
mysql -u admin -h db -p
# password
# you should be connected now.
# if this step fails - your docker inter-container connectivity is having issues