首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >连接Spring Boot-MySql :不允许公钥检索

连接Spring Boot-MySql :不允许公钥检索
EN

Stack Overflow用户
提问于 2019-08-08 23:58:20
回答 2查看 6.9K关注 0票数 5

今年6月初,我运行了我的一个应用程序,没有任何问题。在今天再次尝试之后,我在控制台中得到以下错误:

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed

对如何修复有什么建议吗?

我对此进行了研究,但没有发现任何针对Spring Boot应用程序的特定内容。

applications.properties中的设置:

代码语言:javascript
复制
spring.mvc.view.prefix=/WEB-INF/views/

spring.mvc.view.suffix=.jsp

spring.datasource.url = jdbc:mysql://localhost:3306/testdb?verifyServerCertificate=false&useSSL=false&requireSSL=false&useJDBCCompliantTimezoneShift=true&serverTimezone=UTC
spring.datasource.username = root
spring.datasource.password = 


spring.jpa.show-sql = true 


spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto = update


spring.jpa.hibernate.naming.implicit-strategy = org.hibernate.cfg.ImprovedNamingStrategy

spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed

EN

回答 2

Stack Overflow用户

发布于 2020-06-01 01:13:35

请使用以下内容

代码语言:javascript
复制
jdbc:mysql://localhost:3306/payphone?useSSL=false&useJDBCComplaintTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
票数 9
EN

Stack Overflow用户

发布于 2019-08-09 01:22:11

可能的解决方案:

1-检查mysql是否使用端口3306以及它是否处于活动状态。

2-确保您的mysql用户名和密码正确。

3-如果您使用的是MySQL8或更高版本,则可以选中身份验证插件更改表单this link

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57416600

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档