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.

This is a weird error that I am seeing while running a liquibase script. It seems to happen intermittently but can’t get rid of it.

I realized that I was able to get around it by making sure that no active connections to the mysql instance were present.

For example:

Run liquibase script->runs fine

Connect to mysql db from another window using command line or sequel pro 

Run liquibase script from first window …you see this error.

"Unexpected error running Liquibase: 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."

Any ideas on what is the root cause of this?

Hey John, were you able to resolve this issue? I’m getting the same error message intermittently when trying to run the Liquibase scripts.

Hi @bobo135

Could you please help us with more details about the issue you are facing? Also the Liquibase version you are using.

Thanks!
Rakhi Agrawal

Hi @rakhi,

I’m getting a similar error when trying to deploy the Liquibase scripts to an AWS Aurora RDS instance:

Unexpected error running Liquibase: Connection could not be created to jdbc:mysql://<DB_URL_HERE>:3306/cloudmapdb with driver com.mysql.cj.jdbc.Driver.  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’m using Liquibase version 4.4.0 and MySQL jar version mysql-connector-java-8.0.25.jar. This was working successfully in the past, but I suddenly started getting the errors above last month. I’ve verified that the DB is up and running, and I’m able to connect via terminal using the traditional mysql -u username -p route.

Also, the scripts occasionally still run successfully, but when I try running them again they fail with the same error.

Thanks,
Boris