步骤
pom.xml 引入依赖<!--spring监控--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><!-- druid数据源 --><dependency><groupId>com.alibaba</groupId><artifactId>druid-spring-boot-starter</artifactId><version>1.1.10</version></dependency>
application.yml 配置druid(最简单的)
# druid配置datasource.type: com.alibaba.druid.pool.DruidDataSourcedatasource:druid:driver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://localhost:3306/test?chracterEncoding=utf8&useSSL=false&serverTimezone=UTCusername: rootpassword: root
访问 http://localhost:8080/项目名/druid/index.html