springboot中使用Mysql+druids数据库连接池配置

1. 添加依赖

 
        
            mysql
            mysql-connector-java
            8.0.19
        
        
        
            com.alibaba
            druid
            1.1.20
        

2.配置文件信息

application.properties中数据库相关配置

##数据库地址
spring.datasource.url=jdbc:mysql://39.105.189.141:3307/db_yq1906?characterEncoding=UTF-8&&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=qfjava
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.type: com.alibaba.druid.pool.DruidDataSource

你可能感兴趣的:(SpringBoot)