druid-spring-boot-starter的配置


#數據源基本信息
spring:
  datasource:
    druid:
      username: root
      password: 123456
      url: jdbc:mysql://localhost:3306/daily?useSSl=ture&serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8
      driver-class-name: com.mysql.cj.jdbc.Driver

#連接池屬性
      initial-size: 15
      max-active: 100
      min-idle: 15
      max-wait: 60000
      time-between-eviction-runs-millis: 60000
      min-evictable-idle-time-millis: 300000
      test-on-borrow: false
      test-on-return: false
      test-while-idle: true
      validation-query: SELECT 1
      validation-query-timeout: 1000
      keep-alive: true
      remove-abandoned: true
      remove-abandoned-timeout: 180
      log-abandoned: true
      pool-prepared-statements: true
      max-pool-prepared-statement-per-connection-size: 20
      filters: stat,wall,slf4j
      use-global-data-source-stat: true
      maxOpenPreparedStatements: 100
      connect-properties.mergeSql: true
      connect-properties.slowSqlMillis: 5000

      # 配置DruidStatFilter
      web-stat-filter:
        enabled: true
        url-pattern: "/*"
        exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
      # 配置DruidStatViewServlet
      stat-view-servlet:
        url-pattern: "/druid/*"
        # IP白名單(沒有配置或者為空,則允許所有訪問)
        allow: 127.0.0.1
        # IP黑名單 (存在共同時,deny優先於allow)
        deny: 192.168.0.1
        #  禁用HTML頁面上的“Reset All”功能
        reset-enable: false
        # 登錄名
        login-username: admin
        # 登錄密碼
        login-password: 123456
        # 新版需要配置這個屬性才能訪問監控頁面
        enabled: true


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM