After configuring Confluence with MySQL v8, getting INFO message about deprecated JDBC Driver

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When upgrading the Confluence repository to MySQL v8 or when configuring a new Confluence environment with MySQL v8, you may get a INFO message related to the MySQL Driver used. =

Do note that starting with Confluence 8, MySQL 5.7 is not part of the Supported Platforms anymore.  


Environment

Confluence 7.19.X or Confluence 8.X running with MySQL v8

Diagnosis

In the atlassian-confluence.log  files you will notice the following message while starting Confluence: 

2021-08-26 14:57:06,204 INFO [Catalina-utility-1] [atlassian.confluence.cluster.DefaultClusterConfigurationHelper] lambda$populateExistingClusterSetupConfig$5 Populating setup configuration if running with Cluster mode...
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

Cause

MySQL changed the API Connector/J driver from com.mysql.jdbc.Driver to com.mysql.cj.jdbc.Driver. This is documented by MySQL itself under MySQL Connector Developer Guide > 4.4.1.3 Changes in the Connector

The name of the class that implements java.sql.Driver in MySQL Connector/J has changed from com.mysql.jdbc.Driver to com.mysql.cj.jdbc.Driver. The old class name has been deprecated.

Solution

To avoid these messages, you need to change the JDBC Driver name in your confluence.cfg.xml as described in our documentation Configuring a datasource connection

...
...
    <property name="hibernate.connection.driver_class">com.mysql.cj.jdbc.Driver</property>
...
...

Please, restart Confluence after this change is implemented. 



Last modified on May 23, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.