Re: Communications link failure
Posted by: Dinesh Varyani
Date: September 23, 2012 02:03PM

Hi,

If you get a SQLException: Connection refused or Connection timed out or a MySQL specific CommunicationsException: Communications link failure, then it means that the DB isn't reachable at all. This can have one or more of the following causes:

IP address or hostname in JDBC URL is wrong.
Hostname in JDBC URL is not recognized by local DNS server.
Port number is missing or wrong in JDBC URL.
DB server is down.
DB server doesn't accept TCP/IP connections.
DB server has run out of connections.
Something in between Java and DB is blocking connections, e.g. a firewall or proxy.

To solve the one or the other, follow the following advices:

Verify and test them with ping.
Refresh DNS or use IP address in JDBC URL instead.
Verify it based on my.cnf of MySQL DB.
Start the DB.
Verify if mysqld is started without the --skip-networking option.
Restart the DB and fix your code accordingly that it closes connections in finally.
Disable firewall and/or configure firewall/proxy to allow/forward the port.

Jontymagicman,
owner of http://www.hubberspot.com

Options: ReplyQuote


Subject
Written By
Posted
November 27, 2012 08:23AM
November 27, 2012 11:18AM
January 06, 2013 01:46PM
January 08, 2013 04:25PM
January 08, 2013 11:11PM
January 09, 2013 10:36AM
January 10, 2013 08:23AM
January 18, 2013 02:02PM
Re: Communications link failure
September 23, 2012 02:03PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.