Confirm the Server & Database Details- Make sure the MySQL database server is running.
- Check IP address or hostname in JDBC URL is wrong.
- The hostname in JDBC URL is not recognized by the local DNS server.
- The Port number is missing or wrong in JDBC URL.
- DB server doesn't accept TCP/IP connections.
Jun 6, 2010CommunicationsException exception occurs if your database connection is idle for long time. This idle connection returns true on connection.Solving a "communications link failure" with JDBC and MySQLcom.mysql.cj.jdbc.exceptions.CommunicationsExceptionjava - com.mysql.jdbc.exceptions.jdbc4.CommunicationsException java - com.mysql.cj.jdbc.exceptions.CommunicationsException More results from stackoverflow.com
You would also get this error when you are unable to connect to the MySQL database servers as it might be down or some of your connection properties using are not right. So make sure the following. Check IP address or hostname in JDBC URL is wrong. The hostname in JDBC URL is not recognized by the local DNS server.
I have had the same problem in two of my programs. My error was this: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link...Best answer · 487
If you are using MAMP PRO, the easy fix, which I really wish I had realized before I started searching the internet for days trying to figure this...18
Setting the bind-address to the server's network IP instead of the localhost default, and setting privileges on my user worked for me. my.cnf: bi...9
In my case, Change the remote machine mysql configuration at /etc/mysql/my.cnf : change
bind-address = 127.0.0.1
to
#bind-address = 127.0.0....5
I've just faced the same problem.
It happened because the MySQL Daemon was binded to the IP of the machine, which is required to make connection wi...5
In my case (I am a noob), I was testing Servlet that make database connection with MySQL and one of the Exception is the one mentioned above. It ma...5
In case you are having problem with a set of Docker containers , then make sure that you do not only EXPOSE the port 3306 , but as well map the...4
In my case it was an idle timeout, that caused the connection to be dropped on the server. The connection was kept open, but not used for a long pe...3
As the detailed answer above says, this error can be caused by many things. I had this problem too. My setup was Mac OSX 10.8, using a Vagrant man...3