0
点赞
收藏
分享

微信扫一扫

mysql8默认caching_sha2_password身份验证

发生这个问题的原因是在 mysql 8.0 以后,caching_sha2_password是默认的身份验证插件,而不是以往的mysql_native_password。在 MySQL Command Line 工具下修改 mysql 的默认身份验证插件即可。

The server requested authentication method unknown to the client [caching_sha2_password]


“The server requested authentication method unknown to the client.”的解决方案


mysql - uroot - p

--使用用户名密码登录 mysql

USE mysql;

--使用 mysql 数据库

ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY '12345678';

--修改身份验证插件,假设用户名为 root,密码为 12345678(请改为你自己的用户名和密码)。

FLUSH PRIVILEGES;

--使更改生效

举报

相关推荐

0 条评论