mysql获取“java.sql.SQLNonTransientConnectionException”的spring启动应用程序
当我使用MySQL 5.7.X启动SpringBoot1.3应用程序时,我在应用程序启动时遇到以下异常。任何帮助都将不胜感激 驱动程序管理连接不正确的状态,并使用 java.sql.SQLNonTransientConnectionException:公钥检索mysql获取“java.sql.SQLNonTransientConnectionException”的spring启动应用程序,java,mysql,spring-boot,Java,Mysql,Spring Boot,当我使用MySQL 5.7.X启动SpringBoot1.3应用程序时,我在应用程序启动时遇到以下异常。任何帮助都将不胜感激 驱动程序管理连接不正确的状态,并使用 java.sql.SQLNonTransientConnectionException:公钥检索 我能够理解这一点,这是由于我在mysql中配置用户权限的方式。我使用的身份验证方法是SHA256,当我将其更改为正常时,它开始工作。请查看此以了解更多详细信息 在我的例子中,我在application.properties中使用了以下块:
我能够理解这一点,这是由于我在mysql中配置用户权限的方式。我使用的身份验证方法是SHA256,当我将其更改为正常时,它开始工作。请查看此以了解更多详细信息 在我的例子中,我在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*
您应该向mysql连接器allowPublicKeyRetrieval=true添加客户端选项 spring.datasource.url=jdbc:mysql://localhost:3306/ponto_inteligente?allowPublicKeyRetrieval=true
你能发布你的代码和类吗?你改变的第二行是什么?