SpringBootスターターはDruidデータソースを統合し、http:// localhost:8080 / druidにアクセスできません

まず、次の構成が正しいことを確認します

spring:
  datasource:
    url: jdbc:mysql://localhost:3306/eesy
    username: root
    password: qwer
    driver-class-name: com.mysql.jdbc.Driver

    druid:
      aop-patterns: com.marchsoft.admin.* # 配置要扫描的包
      filters: stat,wall # 配置监控防火墙

      stat-view-servlet: # 开启了statViewServlet功能,也就是监控页的配置
        enabled: true
        login-username: admin
        login-password: admin
        resetEnable: false

      web-stat-filter: # 监控web应用,开启web监控功能
        enabled: true
        urlPattern: /*
        exclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'


      filter:
        stat:
          slow-sql-millis: 1000 #设置所有超过1000行的查询都是慢查询
          logSlowSql: true
          enabled: true
        wall: #开启防火墙的功能
          enabled: true
          config:
            drop-table-allow: false

上記の設定が正しい場合は、pom設定ファイルに次のコードが含まれているかどうかを確認してください

        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.1.17</version>
        </dependency>

と置換する

        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
            <version>1.1.17</version>
        </dependency>

注:これはに置き換えられます

おすすめ

転載: blog.csdn.net/weixin_45566730/article/details/114188414
おすすめ