添加依赖 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.2.15</version> </dependency> 配置数据源 spring: datasource: druid: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://43.143.181.xxx:3306/xxx?useSSL=false&serverTimezone=UTC username: root password: xxx 查看启动信息 2023-04-24 02:33:59.810 INFO 19628 --- [ main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource 2023-04-24 02:34:00.054 INFO 19628 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited