凡事总要有信心,老想着“行”。要是做一件事,先就担心着"怕咱不行吧”,那你就没有勇气了。——盖叫天

今天报了这么一个错

image-20211117205258813

数据库连接不上了,重连也失败,超时

解决办法:

加上hikari配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
spring:
# 数据源配置
datasource:
hikari:
connection-test-query: SELECT 1 FROM DUAL
connection-timeout: 600000
maximum-pool-size: 500
max-lifetime: 1800000
minimum-idle: 20
validation-timeout: 3000
idle-timeout: 60000
connection-init-sql: SET NAMES utf8mb4
driver-class-name: com.mysql.cj.jdbc.Driver
username: ruben
password: rubenFoolish
url: jdbc:mysql://localhost:3306/ruben?autoReconnect=true&zeroDateTimeBehavior=CONVERT_TO_NULL&useUnicode=true&characterEncoding=utf-8&useSSL=false&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&allowMultiQueries=true&allowPublicKeyRetrieval=true
server:
port: 8080

image-20211117205435878