The unit is connected virtual machines docker started mysql database

First, to ensure network this function to access a virtual machine

And opened the virtual machine's access port mysql

Into the container

docker exec -it 容器id /bin/bash

Mysql database into the open remote access

  • 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 remote connection mysql -h 192.168.218.129 -uroot -p -P 3306

Guess you like

Origin www.cnblogs.com/zwq-/p/11221013.html