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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM