MySQL8.0远程连接报错Authentication plugin 'caching_sha2_password'解决方法
参考:
https://blog.csdn.net/ZHY_ERIC/article/details/124470136
MySQL8.0远程连接报错
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
原因是:mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password。
解决方法
进入MySQL
# mysql -uroot -p
修改账户密码加密规则并更新用户密码:
# 修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
# 更新一下用户的密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
刷新权限并重置密码
# 刷新权限(可以直接复制)
flush privileges;
重置密码
#自定义密码
alter user 'root'@'localhost' identified by 'dgdggdgdg';