24 lines
958 B
YAML
24 lines
958 B
YAML
server:
|
||
port: 9090
|
||
spring:
|
||
data:
|
||
redis:
|
||
port: 6379
|
||
password: ""
|
||
database: 0
|
||
timeout: 10000
|
||
datasource:
|
||
# 连接 URL(关键:test_db 是你要连接的数据库名,需提前创建)
|
||
url: jdbc:mysql://rm-f8z6oc5a03331500p8o.mysql.rds.aliyuncs.com:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||
# 数据库用户名
|
||
username: root
|
||
# 数据库密码(替换为你的 MySQL 密码)
|
||
password: Root123456
|
||
# 驱动类名(MySQL 8.x 用这个,5.x 改为 com.mysql.jdbc.Driver)
|
||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||
# 连接池配置(可选,提升性能)
|
||
hikari:
|
||
maximum-pool-size: 10 # 最大连接数
|
||
minimum-idle: 2 # 最小空闲连接数
|
||
idle-timeout: 60000 # 空闲连接超时时间(毫秒)
|
||
connection-timeout: 30000 # 连接超时时间(毫秒) |