How to fix this java mysql exception: Communications link failure?

后端 未结 2 1317
情深已故
情深已故 2021-01-19 07:30

Here is the log of this exception:

    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully rec         


        
2条回答
  •  南笙
    南笙 (楼主)
    2021-01-19 08:07

    I had com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure reading more on the error message I realized it had to do with my SSL setting in the connection string. When you have SSL enabled in your connection string for MySQL.Please make sure your date and time are correct or in sync with the current date. If not the connection will be hit with javax.net.ssl.SSLHandshakeException resulting in The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. . prompting you to do something about your date. This is how I solved mine. I had to set my date and time correctly. Sometimes the error messages say a lot about the problem.

提交回复
热议问题