首先要保证本机能访问虚拟机的网络

并且虚拟机开通了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

相关文章:

  • 2021-04-03
  • 2021-09-19
  • 2021-11-09
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
猜你喜欢
  • 2021-05-19
  • 2021-10-03
  • 2021-10-12
  • 2022-01-22
  • 2021-11-23
  • 2021-10-23
  • 2021-09-01
相关资源
相似解决方案