Tomcat启动报错:Client does not support authentication protocol requested by server; consider upgrading MySQL client

这几天接触了tomcat+nginx负载均衡,在大部分工作都完成后,启动tomcat时发现报错:Client does not support authentication protocol requested by server; consider upgrading MySQL client,根据日志提示需要升级mysql,尝试升级后再次启动tomcat时还是会出现此错误。

于是只能借助万能的百度了,根据百度搜索到的解释是因为:mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password,那接下来要做的就是更改mysql的加密规则了。

管理员打开命令提示符连接mysql后执行

alter user 'root'@'localhost' identified with mysql_native_password by 'password';

然后执行flush privileges;重启mysql服务后启动tomcat后恢复正常

参考文章:《解决Navicat for MySQL连接 Mysql 8.0.11 出现1251- Client does not support authentication protocol错误

但可能会出现另一种错误:Access denied for user ‘root’@’localhost’ (using password: NO),该问题解决可见文章《tomcat启动/Navicat连接时报错:Access denied for user ‘root’@’localhost’ (using password: NO)

发表回复 0

邮箱信息不会被公布. 必填内容需填写 *

Captcha Code