Skip to content

Instantly share code, notes, and snippets.

@darcwader
Last active March 26, 2019 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darcwader/fcab5d9ff79ae9ccca8a0eaacdd5c87b to your computer and use it in GitHub Desktop.
Save darcwader/fcab5d9ff79ae9ccca8a0eaacdd5c87b to your computer and use it in GitHub Desktop.
access mysql inside docker in host
/*
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