I have a Java client application that connects to a mysql
server. Both the client and the server are running in docker containers.
I noticed that the official mysql Docker image recently updated the mysql service to run Version: '8.0.1-dmr'
Since this change, my Java client application cannot connect to the mysql instance; it fails with the following error:
Caused by: java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910) ~[mysql-connector-java-5.0.8-bin.jar:na]
at com.mysql.jdbc.Connection.configureClientCharacterSet(Connection.java:2412) ~[mysql-connector-java-5.0.8-bin.jar:na]
at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:4139) ~[mysql-connector-java-5.0.8-bin.jar:na]
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2789) ~[mysql-connector-java-5.0.8-bin.jar:na]
at com.mysql.jdbc.Connection.<init>(Connection.java:1555) ~[mysql-connector-java-5.0.8-bin.jar:na]
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285) ~[mysql-connector-java-5.0.8-bin.jar:na]
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:307) ~[tomcat-jdbc-8.0.20.jar:na]
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:200) ~[tomcat-jdbc-8.0.20.jar:na]
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:699) ~[tomcat-jdbc-8.0.20.jar:na]
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:633) ~[tomcat-jdbc-8.0.20.jar:na]
at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:186) ~[tomcat-jdbc-8.0.20.jar:na]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:126) ~[tomcat-jdbc-8.0.20.jar:na]
I do not own the source code of the Java client application so I cannot easily upgrade the JDBC driver it is using (which is mysql-connector-java-5.0.8-bin.jar
).
This was working with the previous mysqldb:8
docker image which was running mysqld Version: '8.0.0-dmr'
Is there any workaround to this issue that does not involve updating the JDBC driver? Is this a regression in mysqld
?