你在使用 Spring Boot 吗?如果您使用的是 Spring Boot,则可以尝试通过属性进行设置:spring.datasource.hikari.*= # Hikari specific settings使用 MySQL 的属性文件示例之一:spring.datasource.hikari.mysql.driver-class-name=com.mysql.jdbc.Driverspring.datasource.hikari.mysql.jdbc-url=jdbc:mysql://10.0.9.198:3306/develop_report?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&rewriteBatchedStatements=truespring.datasource.hikari.mysql.username=rootspring.datasource.hikari.mysql.password=123456spring.datasource.hikari.mysql.minimum-idle=5spring.datasource.hikari.mysql.idle-timeout=180000spring.datasource.hikari.mysql.maximum-pool-size=20spring.datasource.hikari.mysql.auto-commit=truespring.datasource.hikari.mysql.pool-name=Mysql-spring.datasource.hikariCPspring.datasource.hikari.mysql.max-lifetime=1800000spring.datasource.hikari.mysql.connection-timeout=30000spring.datasource.hikari.mysql.connection-test-query=SELECT 1spring.datasource.hikari.mysql.validation-timeout=5000