springboot+MySQL8项目启动报Public Key Retrieval is not allowed 错误的解决方法

将spring boot项目的数据库改为MySQL8后,项目启动报错如下:

java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed

在application.yml配置数据库连接的url后面,加上:

&allowPublicKeyRetrieval=true

 

posted on 2020-03-21 21:15  江上酒,故人倾  阅读(1343)  评论(0编辑  收藏  举报