问题描述
- 今天启动项目突然抛出如下错误信息:
[16:14:32.735][ERROR][com.alibaba.druid.pool.DruidDataSource][main] init datasource error, url: jdbc:mysql://localhost:3306/test
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server
原因
- 查资料最后得出结论:MySQL在高版本需要指明是否进行SSL连接
解决办法
- 设置
useSSL=false,更改连接URL如下
jdbc:mysql://localhost:3306/test?useSSL=false
博客内容描述了在启动项目时遇到的MySQL通信异常,原因是由于MySQL高版本需要指定SSL连接设置。解决方案是在数据库连接URL中添加`useSSL=false`参数,如`jdbc:mysql://localhost:3306/test?useSSL=false`,从而成功建立连接。
8008

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



