Last active
March 26, 2019 14:49
-
-
Save darcwader/fcab5d9ff79ae9ccca8a0eaacdd5c87b to your computer and use it in GitHub Desktop.
access mysql inside docker in host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
docker run --name=mysql1 -p 3306:3306 -d mysql/mysql-server:5.6 | |
docker logs mysql1 2>&1 | grep GENERATED | |
docker exec -it mysql1 mysql -uroot -p | |
*/ | |
set password=password('password'); | |
create user 'dbuser'@'%' identified by 'password'; | |
grant all privileges on *.* to 'dbuser'@'%' with grant option; | |
flush privileges; | |
/* | |
NOTE: | |
make sure to use 127.0.0.1 to connection string and not localhost. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment