| | |
| | | # 数据源配置 |
| | | spring: |
| | | autoconfigure: |
| | | exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | dynamic: |
| | | datasource: |
| | | # 主库数据源 |
| | | master: |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true |
| | | username: root |
| | | password: root |
| | | # 从库数据源 |
| | | slave: |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: |
| | | username: |
| | | password: |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true |
| | | username: root |
| | | password: root |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # 初始连接数 |
| | | initialSize: 5 |
| | | # 最小连接池数量 |
| | |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | # 注意这个值和druid原生不一致,默认启动了stat |
| | | filters: stat |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |