Loading

连接MySql报错Unable to load authentication plugin 'caching_sha2_password'。

连接MySql报错Unable to load authentication plugin 'caching_sha2_password'.。
原因是由于mysql8 默认为caching_sha2_password,而原先为mysql_native_password。
解决方案:
在MySQL中执行

ALTER USER 'root'@'localhost' IDENTIFIED BY '密码' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '密码';
FLUSH PRIVILEGES;
posted @ 2020-05-14 11:01  摇橙子  阅读(1220)  评论(0编辑  收藏  举报