spring boot连接MySQL8提示Public Key Retrieval is not allowed错误解决方法

背景:

spring boot + MySQL 8,之前连接是正常的,今天启动项目,出现报错:Public Key Retrieval is not allowed

 

解决方法:在MySQL的连接参数里,添加下面这段配置:

allowPublicKeyRetrieval=true

 

造成这个问题的原因,有可能是使用的MySQL驱动版本和协议,与MySQL数据库的版本之间存在差异,可以检查一下spring boot使用的MySQL数据库连接字符串

 

参考资料:

https://www.cnblogs.com/lusaisai/p/13372763.html

posted @ 2022-05-09 09:13  jamstack  阅读(887)  评论(0编辑  收藏  举报