init datasource error, url: jdbc:mysql://localhost:3306/test 解决办法
问题描述今天启动项目突然抛出如下错误信息:[16:14:32.735][ERROR][com.alibaba.druid.pool.DruidDataSource][main] init datasource error, url: jdbc:mysql://localhost:3306/testcom.mysql.cj.jdbc.exceptions.CommunicationsExceptio
·
问题描述
- 今天启动项目突然抛出如下错误信息:
[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
更多推荐
已为社区贡献1条内容
所有评论(0)