100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > SpringBoot-使用druid 数据源及其监控

SpringBoot-使用druid 数据源及其监控

时间:2022-06-09 21:04:04

相关推荐

SpringBoot-使用druid 数据源及其监控

步骤

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

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。