aspose file tools*
The moose likes JDBC and the fly likes TCP/IP over SSH-com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "TCP/IP over SSH-com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure" Watch "TCP/IP over SSH-com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure" New topic
Author

TCP/IP over SSH-com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Rudra Narayan Garnaik
Ranch Hand

Joined: May 05, 2006
Posts: 39
Hi All,
I have MySQL installed in centOS (remote linux), To access mysql i need to loging using my user credential and then use the mysql database credential.

In java end I getting the following error as follows:

Console Error:

21 Sep 2011 16:06:59,527 4299 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 08S01
21 Sep 2011 16:06:59,527 4299 [main] ERROR org.hibernate.util.JDBCExceptionReporter - 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.
21 Sep 2011 16:06:59,528 4300 [main] WARN org.hibernate.cfg.SettingsFactory - Could not obtain connection metadata
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.
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:407)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:346)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2334)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2371)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2163)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
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:407)


It seems some how I am not able to manage the first level authentication (my host user id/pwd) through code, only I am using the IP of server and port of mysql. By using the Linux box it looks mysql is running on localhost. please suggest.

Hints: I may need some tunneling?
I used Putty not works for me.

Please help. Thanks in advance.


Regards, Rudra Narayan
www.garnaik.com
Rudra Narayan Garnaik
Ranch Hand

Joined: May 05, 2006
Posts: 39
I am accessing the MySQL from Window 7 system.

Using Eclipse withTomcat.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TCP/IP over SSH-com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure