Mysql Can't reach database server or port com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last

时间:2021-09-04
本文章向大家介绍Mysql Can't reach database server or port com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last,主要包括Mysql Can't reach database server or port com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

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 -hlocalhost -uroot -p却可以正常连接。

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

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

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

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

参考:

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

电信校园卡300一年500两年20GB+10GB通用流量200分钟通话30GB定向流量 v:13641304639

如果没有一直坚持,也不会有质的飞跃,当生命有了限度,每个人的价值就会浮现。

船长博客,期待共同交流提高!

本文如对您有帮助,记得点击右下边小球【赞一下】,热烈期待您关注博客 n(*≧▽≦*)n

原文地址:https://www.cnblogs.com/v5captain/p/15225882.html