Bug #111697 MySQL Java Driver is not able to connect to MariaDB after upgrading to 11.x.x
Submitted: 8 Jul 2023 10:24 Modified: 10 Jul 2023 13:14
Reporter: kyngs kyngs Email Updates:
Status: Unsupported Impact on me:
Category:Connector / J Severity:S2 (Serious)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: java, MariaDB, MySQL

[8 Jul 2023 10:24] kyngs kyngs
When I attempt to connect using the "com.mysql.cj.jdbc.Driver" the driver fails to connect with the following exception: "CJException: Unknown system variable 'transaction_isolation'"
I suppose this is because the variable "transaction_isolation" does not exist in MariaDB and is replaced by "tx_isolation"? Perhaps the driver failed to detect that it is connecting to a MariaDB server, not MySQL? 

The only workaround I found is downgrading MariaDB to "10.11.4"

How to repeat:
Install MariaDB 11.0.2
Attempt to connect with MySQL JDBC driver 8.0.33

Suggested fix:
The driver should detect that it is connecting to a MariaDB server and use the correct variable.
[10 Jul 2023 6:24] Frederic Descamps

MySQL and MariaDB are two distinct projects that have diverged in development.

MariaDB is not a drop-in replacement for MySQL anymore and you can not expect that our connectors will be compatible with MariaDB.

Best regards,
[10 Jul 2023 7:49] kyngs kyngs
Hi Frederic,
thanks for the quick reply. MySQL J driver has always been compatible with MariaDB. Dropping this compatibility on MariaDB version 11 is quite unfortunate because many people depend on this.
[10 Jul 2023 13:14] MySQL Verification Team

Thank you for the bug report.
As Frederic explained, our connectors are not compatible with MariaDB. Unsupported!

Ashwini Patil
[6 Nov 2023 13:30] MySQL Verification Team
Bug #112960 marked as duplicate of this one.