How to fix " [08S01] Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. " - mysql

I'm working on a PHP project using PhpStorm + DataGrip + MySQL + WAMP and since then was working normally with remote database with these configurations (see images):
but suddenly I'm getting this error:
[08S01] Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. java.net.ConnectException: Connection refused: connect
Could someone knows what can I do to solve this error?
I already tried to do what I found here (Solving a "communications link failure" with JDBC and MySQL) and that did not work yet.
I expect to connect again normally to my database.

Hi this error is because you are running a MySQL version 5 or 8.0 and later. And your server is configured to use the protocol of TLS 1.2. So, you need to enable TLS Protocols.
Open Datagrip
Go to Properties
Data Sources > Advanced
In enabledTLSProtocol set the value:
TLSv1,TLSv1.1,TLSv1.2,TLSv1.3
Test connection. And should work!

edit the JDBC url and append this query parameter &enabledTLSProtocols=TLSv1.2

Related

mysql connection with sql developer

I try to create a mysql connection with sql developer on MAC.
I loaded the mysql driver.
I tried to create a connection
But I had the following error
Statut : échec -Echec du test : Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
I resolved the issue by re installing the last version of mysql with the correct driver. Furthermore I had to execute the following mysql command
SET GLOBAL time_zone = '+8:00';

Connecting MySQL remote url to spring boot application

I am trying to connect to my remote MySQL database which is on the server, in my application.properties I have following config
spring.jpa.hibernate.ddl-auto=create
spring.datasource.url=jdbc:mysql://www.mydomain.com:3306/my_database_name
spring.datasource.username=my_username
spring.datasource.password=my_password
But i get this error
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Can anyone please tell me what am i doing wrong ?
Make sure remote connection is enabled on MySQL server ( Try connecting from workbench or other sql client from your local machine with above username and password to test if remote connection is active. Activate if not active
Make sure port 3306 is open on server ( in firewall of server)
Make sure domain is getting resolved correctly ( ping www.my_domain.com

liquibase SSL peer shut down incorrectly

I have a problem integrating liquibase maven execution with a mysql 5.7 database provided by azure as a Service.
the error log is:
Failed to execute goal org.liquibase:liquibase-maven-plugin:3.0.5:status (default-cli) on project — : Error setting up or running Liquibase: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 575 ms ago. Remote host closed connection during handshake: SSL peer shut down incorrectly.
this is the connection string I give to liquibase:
jdbc:mysql://server-name:3306/db-name?useSSL=true&requireSSL=false
Any suggestion?
I have just tryed to set -Dhttps.protocols=TLSv1.1,TLSv1.2
but nothing changed..
Fixed issue using version 8.0.12 of mysql unit connector and updating jdbc URL with useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC for the jdbc time zone parameter
mysql on azure uses by default the ssl security protocol

fail to connect to MySQL using IntelliJ IDEA

I wanted to use Hibernate, so I created a MySQL datasource by database of IntelliJ IDEA. But I got a problem that "connection to MySQL" failed.
I did not change any default setting and just added "demo" as database name.
Here is the description of the problem returned by IntelliJ IDEA.
Connection to MySQL - demo#localhost failed.
Communications link failure.
The last packet sent successfully to the server was 0 milliseconds ago.
The driver has not received any packets from the server.
(4s)
Sorry but there is no further information about the problem.
I granted IntelliJ IDEA the permission to access Internet since I can download packages via Maven dependencies, so probably there is not any problem with my Internet.

Jira: Error connecting to database

I created a MySQL RDS instance at AWS(Amazon web services).When I tried to test connection(Database) during the "Jira" installation, I am facing the below issue:
Error connecting to database
Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Connection timed out: connect
when I tried to connect through MySQL localhost I am facing the below issue:
Error connecting to database
Unknown system variable 'storage_engine'
Try to remove 'storage_engine' variable from db url in /var/atlassian/application-data/jira/dbconfig.xml.
New mysql does not support this parameter as it is default engine now.