Openfire 4.3.0 does not work with MySQL 5.1

After upgrading from 4.2.3 to 4.3.0 connection to MySQL database fails with the exception below.

Reverting back to 4.2.3 lets openfire connect to MySQL without problems.

I assume that the problem is caused by the upgraded mysql driver (8.0.12) in openfire 4.3.0, which might not be compatible with older MySQL versions?

However, the changelog does not mention anything about database versions not being supported anymore.
On the contrary, the openfire installation instructions for mysql state:

Make sure that you are using MySQL 4.1.18 or later (5.x recommended).

I would like to report this as an issue but the Openfire Jira does not allow me to create issues.

Exception:

ERROR org.jivesoftware.database.DbConnectionManager - CLIENT_PLUGIN_AUTH is required
java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:79) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:832) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:207) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at java.sql.DriverManager.getConnection(DriverManager.java:664) ~[?:1.8.0_112]
	at java.sql.DriverManager.getConnection(DriverManager.java:247) ~[?:1.8.0_112]
	at org.apache.commons.dbcp2.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:90) ~[commons-dbcp2-2.5.0.jar:2.5.0]
	at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:291) ~[commons-dbcp2-2.5.0.jar:2.5.0]
	at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:883) ~[commons-pool2-2.6.0.jar:2.6.0]
	at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:436) ~[commons-pool2-2.6.0.jar:2.6.0]
	at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:365) ~[commons-pool2-2.6.0.jar:2.6.0]
	at org.apache.commons.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:134) ~[commons-dbcp2-2.5.0.jar:2.5.0]
	at org.jivesoftware.database.DefaultConnectionProvider.getConnection(DefaultConnectionProvider.java:91) ~[xmppserver-4.3.0.jar:4.3.0]
	at org.jivesoftware.database.DbConnectionManager.setConnectionProvider(DbConnectionManager.java:602) [xmppserver-4.3.0.jar:4.3.0]
	at org.jivesoftware.database.DbConnectionManager.ensureConnectionProvider(DbConnectionManager.java:99) [xmppserver-4.3.0.jar:4.3.0]
	at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:121) [xmppserver-4.3.0.jar:4.3.0]
	at org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:438) [xmppserver-4.3.0.jar:4.3.0]
	at org.jivesoftware.util.JiveProperties.init(JiveProperties.java:90) [xmppserver-4.3.0.jar:4.3.0]
	at org.jivesoftware.util.JiveProperties.getInstance(JiveProperties.java:66) [xmppserver-4.3.0.jar:4.3.0]
	at org.jivesoftware.util.JiveGlobals.getProperty(JiveGlobals.java:556) [xmppserver-4.3.0.jar:4.3.0]
	at org.jivesoftware.util.cache.CacheFactory.<clinit>(CacheFactory.java:88) [xmppserver-4.3.0.jar:4.3.0]
	at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:394) [xmppserver-4.3.0.jar:4.3.0]
	at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:639) [xmppserver-4.3.0.jar:4.3.0]
	at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:236) [xmppserver-4.3.0.jar:4.3.0]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [?:1.8.0_112]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [?:1.8.0_112]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:1.8.0_112]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [?:1.8.0_112]
	at java.lang.Class.newInstance(Class.java:442) [?:1.8.0_112]
	at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:4.3.0]
	at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:4.3.0]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_112]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]
	at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85) [i4jruntime.jar:?]
	at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:65) [i4jruntime.jar:?]
Caused by: com.mysql.cj.exceptions.UnableToConnectException: CLIENT_PLUGIN_AUTH is required
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_112]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_112]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_112]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_112]
	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:223) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1443) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.NativeSession.connect(NativeSession.java:165) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:952) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:822) ~[mysql-connector-java-8.0.12.jar:8.0.12]
	... 36 more

This connector most probably has been updated to make Openfire work with newest versions of MySQL or to have better compatibility. I can’t find the exact list of versions it supports, but it seems it works with 5.5 and higher. Which is pretty good as 5.5 is already not in support and is 8 years old (last update on October 2018), 5.1 is 10 years old with last update 5 years ago. It is probably technically possible to make it work with both old and new databases by maybe including two connectors, but it seems too complex. So currently your option is to use 4.2.3. It is probably won’t work if you replace new connector with the old one in the /openfire/lib folder, but you may try.

Documentation tends to get old fast. I have created a ticket to update it and probably not use exact versions at all. https://issues.igniterealtime.org/browse/OF-1669

JIRA is only open for developers and a few community members. Reporting in the forums is the preferred way.

you could try downgrading your driver. take the mysql.jar from 4.2.3 and copy it over the jar included in 4.3