Springboot连接mysql显示Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Conn
Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!报错信息如下:这时要检查application.properties配置文件有没有问题!检查了,没问题,再检查@Valu
·
Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
报错信息如下:
这时要检查application.properties配置文件有没有问题!
检查了,没问题,再检查@Value注解
也没有问题。。。
按照网上帖子里描述的类似问题,什么在url后面加useSSL=false或者统一时区serverTimezone=GMT。
都没用
在一次次摸索中,我把配置改成了这种形式:
spring.datasource.url=jdbc:mysql://localhost:3306/demo?characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false
spring.datasource.username=root
spring.datasource.password=lqb100118
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
再相应修改@Value注解
然后惊喜的发现,绿了。
更多推荐
已为社区贡献1条内容
所有评论(0)