idea连接mysql数据库时连接显示错误caching_sha2_password

缺乏、安全感 2022-10-29 01:58 188阅读 0赞

问题描述

  1. Connection to paradigm@localhost failed.
  2. Unable to load authentication plugin 'caching_sha2_password'.

问题原因

mysql8之前的版本使用的密码加密规则是mysql_native_password,但是在mysql8则是caching_sha2_password,所以需要修改密码加密规则

解决方法

查看用户的密码加密规则

  1. select user,host,plugin,authentication_string from user;

修改密码加密规则

  1. alter user 'root' @'localhost' identified with mysql_native_password by 'root';

注意

‘root’;是把数据库的密码给修改了

发表评论

表情:
评论列表 (有 0 条评论,188人围观)

还没有评论,来说两句吧...

相关阅读