连接本地mysql 8.0报错MySQL said: Authentication plugin 'caching_sha2_password' cannot be loaded:解决办法
2021-04-27 15:21 Tanwheey 阅读(1283) 评论(0) 编辑 收藏 举报问题表现:
1、命令行登录mysql:
#登录mysql,回车输入密码
$mysql -u root -p
2、修改账户密码加密规则并更新用户密码:
#修改加密规则
>ALTER USER 'root'@'localhost' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
#更新用户的密码
>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
3、刷新权限并重置密码
#刷新权限
>FLUSH PRIVILEGES;
4、单独重置密码
>alter user 'root'@'localhost' identified by '123456';
再次登录,成功。