The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received 

  • Post author:
  • Post category:其他



报错信息:


com.alibaba.druid.pool.DruidDataSource

-346367553 [Druid-ConnectionPool-Create-3454745]

– init datasource error, url: jdbc:mysql://192.168.0.5:3306/

ERROR com.alibaba.druid.pool.DruidDataSource  – create connection error

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.

错误背景:


A是应用服务器,B是数据库服务器


运营商:移动云、


数据库:mysql5.6

如果不是这样的背景下,你的错误解决办法可能和我不一样。

解决办法:

设置了服务器安全组,B服务器,也就是数据库服务器,除了设置流入3306安全组,还要设置流出3306的安全组。因为出于安全考虑,B数据库服务器只设置了允许A服务器访问。


如果我的方案结局了您的问题,麻烦请您给点个赞吧!



版权声明:本文为guoxiaoweitaiyuan原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。