链接 🔗

  • GitHub
  • MVNRepository

    安装

    添加依赖:
    1. <!-- https://mvnrepository.com/artifact/com.alibaba/druid-spring-boot-starter -->
    2. <dependency>
    3. <groupId>com.alibaba</groupId>
    4. <artifactId>druid-spring-boot-starter</artifactId>
    5. <version>1.1.21</version>
    6. </dependency>

配置 application.yml

  1. spring:
  2. datasource:
  3. url: jdbc:mysql://localhost:3306/example
  4. username: root
  5. password: root
  6. # 不需要显式配置 type 属性,添加依赖即可
  7. # type: com.alibaba.druid.pool.DruidDataSource