本机连接虚拟机中docker启动的mysql数据库
时间:2019-07-21 13:53:47
收藏:0
阅读:568
首先要保证本机能访问虚拟机的网络
并且虚拟机开通了mysql的访问端口
进入容器
docker exec -it 容器id /bin/bash
进入mysql数据库开启远程访问权限
- mysql -uroot -p
- use mysql
- update user set password_expired = "Y"where user="root";
- ALTER USER‘root‘@‘%‘ IDENTIFIED WITH mysql_native_password BY ‘123456‘;
cmd 远程连接 mysql -h 192.168.218.129 -uroot -p -P 3306
原文:https://www.cnblogs.com/zwq-/p/11221013.html
评论(0)