com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception

If you ever get this error:

com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused: connect

Just check your database configuration, e.g. in the case of mysql, enter the line:

skip-networking

in your my.cnf file

Tags: , , ,

One Response to “com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception”

  1. pandian Says:

    you mean we need to enter skip-networking in my.cnf?? I got this error when that particular line is present. I dont get this problem while removing that.

Leave a Reply