错误截图:
步骤:
1:进入容器内部
```docker exec -it 3acaaaced362 /bin/bash
2:登陆mysql
mysql -u root -p;
3:切换数据库
use mysql;
4:查看root权限
select host,user,plugin,authentication_string from mysql.user;
ALTER USER ‘root‘@‘%‘ IDENTIFIED WITH mysql_native_password BY ‘root‘;
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘root‘;
执行成功后
查看权限:select host,user,plugin,authentication_string from mysql.user;
![](https://img2020.cnblogs.com/blog/1376820/202006/1376820-20200614085824391-439815419.png)
尝试登陆 成功
【mysql环境问题】解决docker 下mysql启动后,navicat链接报错