Spring Boot configuration Druid monitoring and basic feature monitoring use

Druid Spring Boot Starter is used to help you easily integrate Druid database connection pooling and monitoring in Spring Boot projects.
 

Reference: https://github.com/alibaba/druid/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98

1. Introduce dependencies

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>druid-spring-boot-starter</artifactId>
    <version>${druid.version}</version>
</dependency>

To avoid Druid version conflicts, you can delete the original Druid dependencies (which are already dependent on the starter)

2. Configure JDBC (determined according to the specific parameters of the project)

# JDBC配置
spring.datasource.druid.url= jdbc:mysql://ip:3306/database?useUnicode=true&autoReconnect=true&allowMultiQueries=true&useSSL=false 

spring.datasource.druid.username=uername
spring.datasource.druid.password=password
spring.datasource.druid.driver-class-name=com.mysql.jdbc.Driver</

Guess you like

Origin blog.csdn.net/zsj777/article/details/81676689