JDBC CommunicationsException error with AWS Aurora MySQL

Hi everyone,

We’re having an issue that popped up this week where our Lucee 6.1.0.243 server hosted on a Windows Server 2019 server with the MySQL 9.0.0 driver stopped connecting to our RDS database (MySQL 8) out of the blue.

The JDBC error we get is this:

“Error 4: com.mysql.cj.jdbc.exceptions.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.”

Now here’s the strange thing: We tested connecting to the same RDS database using a PHP tool (phpMyAdmin), and also from the windows command line, and in both cases it connects fine, so it seems that something changed on the Lucee server end that breaks JDBC connections.

Note that we’re using the latest JDBC driver compatible with the latest MySQL 8 version. This is bafling.

Any ideas what could be going on here???

In the past week or so, I have come across two such MySQL communication failure reports. Is there perhaps a recent change in the MySQL driver?

Anyway, here are the other two reports:

https://community.adobe.com/t5/coldfusion-discussions/mysql-communication-link-failure/td-p/14816424
I hope you can find useful suggestions there.

I solved the issue. Since I was connecting to Amazon’s AWS RDS MySQL compatible database, and since I know that it is based on a fork of MySQL called MariaDB, I checked to see if there was a JDBC driver specifically for MariaDB in the Lucee administrator, and indeed it was. Replacing the mysql one with it solved the issue.

Two things to note:

  1. MariaDB is supposed to be a drop-in replacement for MySQL, even at the driver level. This proves that not to be the case.

  2. This issue we started having came out of the blue without us updating anything on the server (neither the OS, of Lucee, or JDBC driver), so it seems Amazon changed something on their end which broke compatibility with some JDBC drivers meant to be compatible with MySQL and MariaDB, so be aware of that.

Hope this helps someone else. It was driving me crazy.

What a surprising finding. Thanks for sharing it.

We had an issue with connecting to our AWS RDS instances - out of the blue - too.

It was because we were using SSL in the Lucee datasource configuration - and the AWS CA Certificate had expired.

We could also connect via the command line and via a client, too…
Which really caused some confusion and made troubleshooting very frustrating and also took a lot longer than it really should have.

There are hundreds of messages online about it happening to everyone else, too.