`
stenlylee
  • 浏览: 263523 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

```Last packet sent to the server was 1 ms ago.

阅读更多

Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

 

java.net.ConnectException
MESSAGE: Connection refused: connect

 

java.net.ConnectException: Connection refused: connect

 

Last packet sent to the server was 1 ms ago.
 at com.mysql.jdbc.Connection.createNewIO(Connection.java:2847)

 

莫名其妙出现类似以上的错误,找遍了网上的解决办法,有说MySQL8小时原因造成的,有说连接池问题造成的,有说JDBC驱动问题造成的等等无数。

 

也许这个问题是有可能由于以上等等原因造成,但是在我这里,只是:

 

连接字符串URL中,将localhost改成127.0.0.1,就OK了。

 

至于为什么会这样,暂时不知道,等待原因吧。

分享到:
评论
7 楼 tianduchen 2010-01-29  
你指的是jdbc链库的时候用127.0.0.1,还是所有用localhost的地方全用127.0.0.1?
6 楼 折翼天彬 2009-12-10  
我的一直是127.0.0.1··可还是报这样
5 楼 stenlylee 2009-12-09  
gqsunrise 写道
我修改后怎么不行呢?

由于原因未知,所以修改后成不成,就不好说了
4 楼 gqsunrise 2009-12-03  
我修改后怎么不行呢?
3 楼 stenlylee 2009-05-23  
ysihaoy 写道

恩,我昨天遇到了和你同样的问题,最后也是把localhost换成了127.0.0.1就运行正常了。可是我也不知道原因是什么。等待ing

是不是之前装了Photoshop之类Adobe的东西?
2 楼 haisheng 2009-05-21  
Testing your connectivity with the mysql command-line client will not work unless you add the --host flag, and use something other than localhost for the host. The mysql command-line client will use Unix domain sockets if you use the special host name localhost. If you are testing connectivity to localhost, use 127.0.0.1 as the host name instead.

引用自:http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-troubleshooting.html
1 楼 ysihaoy 2009-03-21  
恩,我昨天遇到了和你同样的问题,最后也是把localhost换成了127.0.0.1就运行正常了。可是我也不知道原因是什么。等待ing

相关推荐

    ## @[Android studio通过jdbc连接mysql基本步骤 以及 遇到的坑“The last packet sent successfully to the server was 0 m

    @[Android studio通过jdbc连接mysql基本步骤 以及 遇到的坑“The last packet sent successfully to the server was 0 milliseconds ago”哈哈] 小白第一次发博客哈哈,记录一下这三个晚上来我的悲惨经历以及我成功...

    解决Cause com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

    Cause com.mysql.jdbc.exceptions.jdbc4.CommunicationsException The last packet successfully received from the server was 47,795,922 ... The last packet sent successfully to the server was 47,795,922

    linux 后台日志 mysql 错误异常的解释(推荐)

    1、Caused by: ... The last packet sent successfully to the server was 56,201,339 milliseconds ago. is longer than the server configured value of ‘wait_timeout’

    关于MySQL的wait-timeout连接超时问题报错解决方案.docx

    Last packet sent to the server was 0 ms ago. 这种错误信息表明,MySQL 连接已经超时,无法与服务器进行通信。如果不是第一次超时后执行,以后每次报错就变成嵌套的错误了。 解决方案 要解决连接超时问题,需要...

    计算机网络第六版答案

    An ISP earns its money by charging each of the the ISPs that connect to the IXP a relatively small fee, which may depend on the amount of traffic sent to or received from the IXP. 15. Google's ...

    docker-app-template:带有节点,React和Postgresql服务器的docker应用模板

    compose up 请注意,第一次运行时,您可能会看到: mvw_flyway | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. (Caused by...

    mysql 异常com.mysql.jdbc.CommunicationsException

    本次异常的具体描述为:“Communications link failure due to underlying exception: **BEGINNESTED EXCEPTION** java.io.EOFException STACK TRACE: java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully...

    Cisco Packet Tracer7.2.2 x64补丁

    The "ptsaplayer.dll" in the .zip package is the patch to fix the issue that Packet Tracer 7.2.2's PTSAPlayer plugin does not work on Windows 7. Apply the patch will fix the issue. Only users using...

    MySQL wait_timeout连接超时

    这种现象在应用中可能导致突然的数据通信中断,表现为“Communications link failure”等错误,提示“Last packet sent to the server was 0 ms ago.”。为了解决这个问题,我们需要深入理解`wait_timeout`参数以及...

    cisco访问控制列表

    Host PC1, attached to the 192.168.1.128/27 subnet should be allowed complete access to the 192.168.1.96/27 subnet b. All other hosts attached to the 192.168.1.128/27 subnet should be allowed only ...

    Cisco Packet Tracer7.2.2 x32补丁

    The "ptsaplayer.dll" in the .zip package is the patch to fix the issue that Packet Tracer 7.2.2's PTSAPlayer plugin does not work on Windows 7. Apply the patch will fix the issue. Only users using...

    BURNINTEST--硬件检测工具

    will need to be sent to Microsoft as per the normal process. However, a log entry will be added to the normal BurnInTest log. - Changes to trace logging to reduce activity when trace logging is not...

    [Packet.Guide.to.Voice.over.IP(2013.2)].Bruce.Hartpence.文字版

    本书《Packet Guide to Voice over IP(2013.2)》由Bruce Hartpence编写,是一本关于VoIP(Voice over Internet Protocol,即通过IP网络传输语音技术)的实用指南。它对VOIP的基础内容进行了深入探讨,并涵盖了搭建...

    The.Linux.Networking.Architecture

    Section C.1. Using ifconfig to Manage Network Devices 572 Section C.2. Using ping to Test the Reachability 575 Section C.3. Using netstat to View the Network State 576 Section C.4. Using ...

    Practical Packet Analysis: Using Wireshark to Solve Real-World Network Problems

    Carve out data in a packet to retrieve the actual files sent across the network Graph traffic patterns to visualize the data flowing across your network Use advanced Wireshark features to understand ...

    Evolved.Packet.System.The.LTE.and.SAE.Evolution.of.3G.UMTS.2008

    1. **3G UMTS**:3G UMTS是第三代移动通信标准,由国际电信联盟(ITU)定义,提供高速数据传输和多媒体服务。它基于WCDMA(Wideband Code Division Multiple Access)技术,显著提升了当时的2G网络能力,为移动...

    Cisco Packet Tracer 8.1.1.0022

    Cisco Packet Tracer 是一款创新的可视化模拟工具,可用于在台式机上练习网络部署、物联网和网络安全技能。 借助 Cisco Packet Tracer,您可以: 将知识付诸实践 准备证书考试 磨练面试技能 Packet Tracer 是一个...

Global site tag (gtag.js) - Google Analytics