SpringBoot 连接配置
1 2 3 4 5 6 7 8 9
| spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource url: jdbc:mysql://1.1.0.1:3306/test?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&allowPublicKeyRetrieval=true username: test password: test db-type: mysql table-schema: test
|
Druid
配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| spring: datasource: druid: validationQuery: select 1 testWhileIdle: true testOnBorrow: true testOnReturn: true time-between-log-stats-millis: 60000 filters: stat web-stat-filter: enabled: true url-pattern: /* exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*,/sql-monitor/*" session-stat-enable: false session-stat-max-count: 1000 profile-enable: true stat-view-servlet: enabled: true url-pattern: /sql-monitor/* reset-enable: true login-username: admin login-password: admin allow: 127.0.0.1 deny: filter: stat: enabled: true log-slow-sql: false slow-sql-millis: 10 wall: enabled: false config: delete-allow: false drop-table-allow: false
|
本文地址: https://github.com/maxzhao-it/blog/post/f46977ff/