Files
RuoYi/ruoyi-admin/src/main/resources/application-druid.yml

57 lines
2.2 KiB
YAML
Raw Normal View History

2018-08-18 23:51:19 +08:00
# 数据源配置
2018-07-09 08:44:52 +08:00
spring:
2018-08-06 09:00:12 +08:00
datasource:
type: com.alibaba.druid.pool.DruidDataSource
2018-12-18 18:16:29 +08:00
driverClassName: com.mysql.cj.jdbc.Driver
2018-08-06 09:00:12 +08:00
druid:
2018-08-18 23:51:19 +08:00
# 主库数据源
master:
2018-12-18 18:16:29 +08:00
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
2018-08-06 09:00:12 +08:00
username: root
password: password
2018-08-18 23:51:19 +08:00
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
2018-08-06 09:00:12 +08:00
# 初始连接数
2019-01-16 14:56:27 +08:00
initialSize: 5
2018-08-06 09:00:12 +08:00
# 最小连接池数量
2019-01-16 14:56:27 +08:00
minIdle: 10
# 最大连接池数量
maxActive: 20
2018-08-06 09:00:12 +08:00
# 配置获取连接等待超时的时间
2019-01-16 14:56:27 +08:00
maxWait: 60000
2018-08-06 09:00:12 +08:00
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
2019-01-16 14:56:27 +08:00
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
2019-03-08 15:25:24 +08:00
testOnReturn: false
webStatFilter:
enabled: true
2019-01-16 14:56:27 +08:00
statViewServlet:
2018-08-06 09:00:12 +08:00
enabled: true
2019-02-28 12:12:21 +08:00
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
2021-04-12 09:01:51 +08:00
login-username: ruoyi
login-password: 123456
2018-08-06 09:00:12 +08:00
filter:
stat:
2019-03-08 15:25:24 +08:00
enabled: true
2019-01-16 14:56:27 +08:00
# 慢SQL记录
2018-08-06 09:00:12 +08:00
log-slow-sql: true
slow-sql-millis: 1000
2019-01-16 14:56:27 +08:00
merge-sql: true
2018-08-06 09:00:12 +08:00
wall:
config:
multi-statement-allow: true