乐趣区

关于java:SpringBoot启动报错Exception-during-pool-initialization

SpringBoot 启动报错:HikariPool-1 – Exception during pool initialization.

2019-03-20 17:30:16.264 INFO 15528 — [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 – Starting…
Tue Sep 25 16:16:16 CST 2018 WARN: Establishing SSL connection without server’s identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn’t set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to ‘false’. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2018-09-25 16:16:17.403 ERROR 15528 — [main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 – Exception during pool initialization.

1、mysql-connector-java

因为 springboot 自带 mysql-connector-java 版本过高,导致连贯失败,最终导致连接池启动失败。
升高 mysql-connector-java 的版本。

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.40</version>
    <scope>runtime</scope>
</dependency>

2、useSSL

useSSL=false 处出错,改为 useSSL=true

3、查看数据库启动

重新启动数据库

退出移动版