MySQL Forums
Forum List  »  Newbie

Problem with connection to MySQL with Java 8
Posted by: Валерий Ткачук
Date: November 19, 2022 08:06PM

Hi all. A rather strange thing happened. Perhaps someone has come across or knows possible solutions, I will be grateful :)

I will try to write my observations point by point this strange phenomenon:

1. The connection to MySQL using Java 8 broke (both locally on the server itself and remotely from my PC). Java versions are different on the PC and on the server.

2. At the same time, the connection to MySQL with client(like Navicat) works (both locally and remotely).

3. The connection stopped working by itself (I did not touch anything).

4. A similar problem was the problem on another server too (but after reinstalling the OS). I fixed it by commenting on the Java security TLS lines (but it shouldn't be like that).

5. With the same java on a PC, I can connect to other remote MySQL databases (on other servers), but not specifically to this problematic server. This gives the impression that either some security certificates or some kind of MySQL configuration have been updated on the server independently.

This is rather strange. Java libraries also updated. But here the point is that before everything worked on the old libraries and broke down in an instant. Could there be a self-updating of something on the server? (although I did not configure them, perhaps such standard settings). Therefore, the error is definitely not on the application side.

If interested - java error:
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(

JDK version in server: 1.8.0_272

JDK version in PC: 1.8.0_301

MySQL version in server: Ver 15.1 Distrib 10.1.47-MariaDB

Options: ReplyQuote

Written By
Problem with connection to MySQL with Java 8
November 19, 2022 08:06PM

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.