Spring Boot:连接MySQL错误Public Key Retrieval is not allowed
2024-07-12 14:45 阅读(309)

环境:

MySQL版本:8.0.17

SpringBoot版本:2.5.15


解决

解决方式很简单,在数据库配置连接字符串spring.datasource.url末尾添加&allowPublicKeyRetrieval=true即可,如下图:

重新启动,恢复正常。