今年6月初,我运行了我的一个应用程序,没有任何问题。在今天再次尝试之后,我在控制台中得到以下错误:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed
对如何修复有什么建议吗?
我对此进行了研究,但没有发现任何针对Spring Boot应用程序的特定内容。
applications.properties中的设置:
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.MySQL5InnoDBDialectcom.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed
发布于 2020-06-01 01:13:35
请使用以下内容
jdbc:mysql://localhost:3306/payphone?useSSL=false&useJDBCComplaintTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&allowPublicKeyRetrieval=true发布于 2019-08-09 01:22:11
可能的解决方案:
1-检查mysql是否使用端口3306以及它是否处于活动状态。
2-确保您的mysql用户名和密码正确。
3-如果您使用的是MySQL8或更高版本,则可以选中身份验证插件更改表单this link
https://stackoverflow.com/questions/57416600
复制相似问题