外部访问docker中的MySQL

 

注:192.168.1.203机器上装有docker,容器在该机器上

 

mysql> use mysql;

mysql> update user set authentication_string = password('123456') where user = 'root';

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY '123456' WITH GRANT OPTION;

 

 

注:创建好库以后需要退出一下workbench再进入时就能看到新建的库

 

 

欢迎加入QQ群一起讨论Linux、开源等技术

posted @ 2019-04-03 17:08  Linux大魔王  阅读(12698)  评论(0编辑  收藏  举报