1.1 异常
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.
不建议在没有服务器身份验证的情况下建立SSL连接。根据MySQL 5.5.45+, 5.6.26+和5.7.6+的要求,如果没有设置显式选项,则必须默认建立SSL连接
解决:
需要在 jdbc url 后加上&useSSL=false
1.2 异常
com.zaxxer.hikari.pool.HikariPool: HikariPool-1 - Exception during pool initialization.
引起程序无法启动的问题是 com.zaxxer.hikari.pool.HikariPool 没能成功被 Spring 创建,原因是你的时区配置的有歧义,
解决:
在 jdbc url 后加上 &serverTimezone=Asia/Shanghai
1.3 警告
Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
加载类“com.mysql.jdbc.Driver”。这是弃用。新的驱动程序类是“com.mysql.cj.jdbc.Driver”。驱动程序是通过SPI自动注册的,通常不需要手动加载驱动程序类。
本文解决MySQL连接中常见的SSL未验证问题,通过在JDBC URL中添加参数禁用SSL或设置时区来解决HikariCP池初始化异常。同时,提醒开发者关于MySQL驱动程序的弃用及替代方案。

2162

被折叠的 条评论
为什么被折叠?



