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

👤 cesii 📅 2021年09月21日 12:15 👁️ 阅读 232 📂

这几天接触了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';

刷新权限,重启mysql

执行flush privileges;重启mysql服务后启动tomcat后恢复正常
参考文章:《https://blog.csdn.net/lc11535/article/details/99195568?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.control&dist_request_id=&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.control
但可能会出现另一种错误:Access denied for user ‘root’@’localhost’ (using password: NO),该问题解决可见文章《https://cesii.cn/426.html


Fatal error: Uncaught Error: Call to undefined function commentPost() in /www/wwwroot/cesii/content/templates/paperbook/echo_log.php:63 Stack trace: #0 /www/wwwroot/cesii/include/controller/log_controller.php(126): include() #1 /www/wwwroot/cesii/include/lib/dispatcher.php(114): Log_Controller->displayContent() #2 /www/wwwroot/cesii/index.php(10): Dispatcher->dispatch() #3 {main} thrown in /www/wwwroot/cesii/content/templates/paperbook/echo_log.php on line 63