The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
时间: 2023-09-20 19:14:42 浏览: 159
根据引用和引用可以看出,连接MySQL数据库失败的原因是通信链路故障。具体错误显示为"The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server."。根据引用中的描述,大部分问题都是修改连接超时的参数,但是修改后并没有解决问题。在查找整体代码时,发现配置文件中MySQL依赖的版本可能不正确。经过将MySQL依赖的版本从6.0.6降低到5.1.47后,问题得以解决,程序成功连接到数据库。提到了另外一种可能性,即将com.mysql.jdbc.Driver替换为com.mysql.cj.jdbc.Driver。这种替换也可能解决连接问题。但是在这个具体例子中,并没有提到进行了此替换。因此,可能原因是引用中的版本更改导致的。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Communications link failure The last packet sent successfully to the server was 0 milliseconds ago](https://blog.csdn.net/weixin_45936094/article/details/124954689)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received](https://blog.csdn.net/qq_42117777/article/details/125931888)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文