【现象】
2022-08-24 14:54:49.130 WARN 174160 --- [nio-8082-exec-3] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 - Failed to validate connection com.mysql.cj.jdbc.ConnectionImpl@7df9ca28 (No operations allowed after connection closed.). Possibly consider using a shorter maxLifetime value.
2022-08-24 14:54:54.146 WARN 174160 --- [nio-8082-exec-3] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 - Failed to validate connection com.mysql.cj.jdbc.ConnectionImpl@7150aa4 (No operations allowed after connection closed.). Possibly consider using a shorter maxLifetime value.
2022-08-24 14:54:54.154 WARN 174160 --- [nio-8082-exec-2] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 - Failed to validate connection com.mysql.cj.jdbc.ConnectionImpl@16c7f560 (No operations allowed after connection closed.). Possibly consider using a shorter maxLifetime value.
【解决方法】
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/user?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
username: root
password: root
修改为:
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/user?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
username: root
password: root
hikari:
connection-timeout: 10000
validation-timeout: 3000
idle-timeout: 60000
login-timeout: 5
max-lifetime: 60000
maximum-pool-size: 10
minimum-idle: 5
read-only: false
更多推荐
Possibly consider using a shorter maxLifetime value.解决方法
发布评论