Mysql Can't reach database server or port com.mysql.jdbc.exceptions.jdbc4.CommunicationsExcepti

Can't reach database server or port

SQLState - 08S01
com.mysql.jdbc.exceptions.jdbc4.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 Can't reach database server or port com.mysql.jdbc.exceptions.jdbc4.CommunicationsExcepti

 ==========解决============

开始以为是数据库的配置问题,但是用mysql -hlocalhost -uroot -p却可以正常连接。

后来百度搜索,说是需要加参数:useSSL=false

因为我的mysql是用的docker起的服务,仍然报错,不能连接。

后来把localhost改成本机IP地址解决了:

jdbc:mysql://192.168.1.34/confluence?useSSL=false

Mysql Can't reach database server or port com.mysql.jdbc.exceptions.jdbc4.CommunicationsExcepti

参考:

https://blog.csdn.net/xiongshengwu/article/details/46981101

上一篇:HDU 5914 Triangle 【构造】 (2016中国大学生程序设计竞赛(长春))


下一篇:渗透学习笔记(三)--SQL注入学习(一)