首页 > 数据库技术 > 详细

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

时间:2021-09-06 06:12:56      阅读:44      评论:0      收藏:0      [点我收藏+]

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

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!