com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

Communications link failure Last packet sent to the server was 0 ms ago.


Samebug tips3

Firewall might be blocking your connection, or MySQL it's not running on your server machine.

Check if you have started your server, or if your server is set to listen to the port you're trying to connect and is waiting to accept connections and check if the firewall isn't blocking your connection.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.


Solutions on the web1375

Solution icon of googlegroups
via Google Groups by craig lipski, 2 weeks ago
Communications link failure Last packet sent to the server was 0 ms ago.

Solution icon of kuali
via Kuali JIRA by Mindi Balmer, 1 year ago
Communications link failure Last packet sent to the server was 0 ms ago.

Solution icon of oraclecommunity
via Oracle Community by 843790, 1 year ago
Communications link failure Last packet sent to the server was 0 ms ago.

Solution icon of oraclecommunity
via Oracle Community by 843859, 1 year ago
Communications link failure Last packet sent to the server was 0 ms ago.

Solution icon of sourceforge
Communications link failure Last packet sent to the server was 0 ms ago.

Solution icon of stackoverflow
Communications link failure Last packet sent to the server was 0 ms ago.

Solution icon of stackoverflow
via Stack Overflow by Tyler Garavaglia
, 1 year ago
Communications link failure Last packet sent to the server was 0 ms ago.

Solution icon of stackoverflow
via Stack Overflow by Abhishek
, 1 year ago
Communications link failure Last packet sent to the server was 0 ms ago.

Solution icon of web
via blogspot.com by Unknown author, 1 year ago
Communications link failure Last packet sent to the server was 0 ms ago.

Solution icon of web
Communications link failure Last packet sent to the server was 0 ms ago.

Stack trace

  • com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2104) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:729) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:283) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at UserAuthPubKey.connectToDB(UserAuthPubKey.java:72) at UserAuthPubKey.main(UserAuthPubKey.java:44) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Once, 2 months ago
2 times, 1 year ago
721 more bugmates