centos7+docker +mysql配置远程连接笔记

1,参考https://yeasy.gitbooks.io/docker_practice/install/centos.html 安装docker

2,参考https://www.runoob.com/docker/docker-install-mysql.html 安装mysql

进入mysql进行操作docker exec -it mysql5719 bash (mysql5719是容器名)

centos7+docker +mysql配置远程连接笔记_第1张图片

 

输入mysql -u root -p,再输入mysql密码

centos7+docker +mysql配置远程连接笔记_第2张图片

 

 

 

mysql -u root –p
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;
mysql>ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';(解决

Authentication plugin 'caching_sha2_password' cannot be loaded错误

)

 

 记得需要配置好centos7的防火墙

centos7+docker +mysql配置远程连接笔记_第3张图片

 

 

 

 

 

 

你可能感兴趣的:(centos7+docker +mysql配置远程连接笔记)