自己试了很多最终采用的方法及截图希望对大家有帮助

1、进入容器bash并进入mysql命令行。

# docker exec -it mysql03 bash
# mysql -uroot -p

Navicat 远程连接docker容器中的mysql 报错1251 - Client does not support authentication protocol 解决办法(本人实测)

2、容器中登录mysql,查看mysql的版本

mysql> status;
--------------

Navicat 远程连接docker容器中的mysql 报错1251 - Client does not support authentication protocol 解决办法(本人实测)

3,进行授权远程连接(注意mysql 8.0跟之前的授权方式不同)

授权

GRANT ALL ON *.* TO 'root'@'%';

刷新权限

flush privileges;

Navicat 远程连接docker容器中的mysql 报错1251 - Client does not support authentication protocol 解决办法(本人实测)

4,更改加密规则

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;

Navicat 远程连接docker容器中的mysql 报错1251 - Client does not support authentication protocol 解决办法(本人实测)

5,更新root用户密码

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; 

刷新权限

flush privileges;

Navicat 远程连接docker容器中的mysql 报错1251 - Client does not support authentication protocol 解决办法(本人实测)

OK,设置完成,再次使用 Navicat 连接数据库

相关文章:

  • 2022-01-18
  • 2021-05-26
  • 2021-04-09
猜你喜欢
  • 2021-07-07
  • 2021-11-21
  • 2021-07-07
  • 2022-12-23
  • 2021-10-27
  • 2021-08-13
  • 2021-05-17
相关资源
相似解决方案