当前位置:   article > 正文

解决:Hikari - Exception during pool initialization._hikaripool-3 - exception during pool initializatio

hikaripool-3 - exception during pool initialization.

记录一下解决方法

首先确保pom.xml文件中有Haikari的坐标

  1. <dependency>
  2. <groupId>mysql</groupId>
  3. <artifactId>mysql-connector-java</artifactId>
  4. <version>8.0.16</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>com.zaxxer</groupId>
  8. <artifactId>HikariCP</artifactId>
  9. </dependency>

然后启动项目,正常。

执行数据库操作:Hikari - Exception during pool initialization.

哎,肯定是哪配置出问题了,百度了一下,发现是mysql连接的问题,URL连接后面追加   useSSL=false

贴出我的配置

  1. server:
  2. port: 8080
  3. spring:
  4. datasource:
  5. url: jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=false
  6. username: root
  7. password: root
  8. driver-class-name: com.mysql.cj.jdbc.Driver
  9. type: com.zaxxer.hikari.HikariDataSource
  10. hikari:
  11. minimum-idle: 10
  12. maximum-pool-size: 50
  13. auto-commit: true
  14. idle-timeout: 30000
  15. pool-name: MyHikari

我的问题解决! 成功取出数据

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号