【问题标题】:spring boot application with mysql getting "java.sql.SQLNonTransientConnectionException"带有mysql的spring boot应用程序获取“java.sql.SQLNonTransientConnectionException”
【发布时间】:2016-09-26 07:17:00
【问题描述】:
当我使用 MySQL (5.7.X) 启动 Spring boot(1.3) 应用程序时,在应用程序启动时出现以下异常。任何帮助将不胜感激
驱动程序管理连接不正确的状态并失败
java.sql.SQLNonTransientConnectionException: Public Key Retrieval
【问题讨论】:
标签:
java
mysql
spring-boot
【解决方案2】:
我能够弄清楚这一点,这是由于我在mysql 中配置用户权限的方式。我使用的身份验证方法为SHA256,当我将其更改为normal 时,它开始工作。请查看此url 了解更多详情。
【解决方案3】:
就我而言,我在 application.properties 中使用了以下块:
#MySql
spring.jpa.hibernate.ddl-auto=none
*spring.datasource.url=jdbc:mysql://localhost:3306/ponto_inteligente?
verifyServerCertificate=false&
autoReconnect=true&
useSSL=false*
spring.datasource.name=USER_LOGIN
spring.datasource.password=USER_PASSWORD
# exibe comandos SQL
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.use_sql_comments=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.type=trace
更改第二行后:
*spring.datasource.url=jdbc:mysql://localhost:3306/ponto_inteligente?
verifyServerCertificate=false&
autoReconnect=true&
useSSL=false&
user=USER_LOGIN&
password=USER_PASSWORD*