druid的数据源配置-yml

spring:
  datasource:
    druid:
      url: jdbc:mysql://localhost:3306/CrmProject?serverTimezone=UTC&SSL=false&characterEncoding=UTF-8
      username: root
      password: 123456
      driver-class-name: com.mysql.jdbc.Driver
      #  数据源其他配置
      initialSize: 5
      minIdle: 5
      maxActive: 20
      maxWait: 60000
      timeBetweenEvictionRunsMillis: 60000
      minEvictableIdleTimeMillis: 300000
      validation-query: SELECT 1 FROM DUAL
      testWhileIdle: true
      testOnBorrow: false
      testOnReturn: false
      poolPreparedStatements: true
      #    配置监控统计拦截的filters 去掉后监控界面sql无法统计,‘wall’用于防火墙
      filters: stat,wall,log4j
      maxPoolPreparedStatementPerConnectionSize: 20
      useGlobalDataSourceStat: true
      connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMills=500
      stat-view-servlet:
        allow:
        login-password: 123456
        login-username: 9977
        url-pattern: /druid/*
        enabled: true

 

你可能感兴趣的:(druid的数据源配置-yml)