1. docker 启停命令
启动 : systemctl start docker
重启docker服务 systemctl restart docker
重启docker服务 sudo service docker restart
关闭 docker service docker stop
命令:docker run -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql
关闭防火墙重试
查看防火墙状态:service iptables status
关闭防火墙:service iptables stop
打开防火墙:service iptables start
连接数据库
docker exec -it mysql bash
mysql -uroot -p -h 192.168.122.1
2.授权
GRANT ALL ON . TO ‘root’@’%’;
3.刷新权限
flush privileges;
4.还不能远程访问,可能Navicat只支持旧版本的加密,需要更改mysql的加密规则
5.更改加密规则
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘password’ PASSWORD EXPIRE NEVER;
6.更新root用户密码
ALTER USER ‘root’@’%’ IDENTIFIED WITH mysql_native_password BY ‘123456’;
7.刷新权限,问题解决?good luck