nacos持久化无法连接mysql8.0以上版本java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'

问题

nacos连接mysql8.0以上版本报如下错

java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'

主要原因是8.x版本的验证模块和之前版本不同:

  • 5.x版本是:default_authentication_plugin=mysql_native_password

  • 8.x版本就是:default_authentication_plugin=caching_sha2_password
    98

解决方案

1- 在nacos安装目录下创建plugins/mysql文件夹,放入8以上版本mysql驱动mysql-connector-java-8.0.19.jar

2- 将conf目录下写有mysql连接配置信息的文件application.properties

改名为bootstrap.properties
3 - 重新启动nacos

posted @ 2021-11-22 15:10  至安  阅读(540)  评论(0编辑  收藏  举报