在对接应用服务时MySQL返回报错:
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默认使用了新的加密规则caching_sha2_password
,而不是之前的规则mysql_native_password
。
解决办法
ALTER USER ‘用户名’@’主机地址’ IDENTIFIED WITH mysql_native_password BY ‘密码’;
使用root账号登录MySQL执行sql语句:
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'lolicp.com';
文章来源于互联网:MySQL8在连接时提示caching_sha2_password未找到