Bug 1646363 - the connector doesn't work with new mysql 8
Summary: the connector doesn't work with new mysql 8
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: mysql-connector-java
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ondrej Dubaj
QA Contact: RHEL CS Apps Subsystem QE
Lenka Špačková
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-05 13:14 UTC by Karel Volný
Modified: 2020-03-24 06:59 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
.`mysql-connector-java` does not work with MySQL 8.0 The `mysql-connector-java` database connector provided in RHEL 7 does not work with the MySQL 8.0 database server. To work around this problem, use the `rh-mariadb103-mariadb-java-client` database connector from Red Hat Software Collections.
Clone Of:
Environment:
Last Closed: 2020-03-24 06:59:36 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1584253 unspecified CLOSED RFE: add collection for MySQL 8.0 2020-10-14 00:28:05 UTC

Internal Links: 1584253

Description Karel Volný 2018-11-05 13:14:15 UTC
Description of problem:
SSIA ... there is a problem using the mysql-connector-java with new mysql 8

first it fails due to different default charset, then there is a datatype issue


Version-Release number of selected component (if applicable):
mysql-connector-java-5.1.25-3.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. install the new rh-mysql80 collection
2. try to use the connector
3. add 'character-set-server=utf8' to mysql server configuration (and restart the daemon)
4. try to use the connector again

Actual results:
2.
 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
       at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
       at com.mysql.jdbc.Util.getInstance(Util.java:386)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
       at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2570)
       at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2306)
       at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:839)
       at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
       at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
       at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:421)
       at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:350)
       at java.sql.DriverManager.getConnection(DriverManager.java:571)
       at java.sql.DriverManager.getConnection(DriverManager.java:215)
       at MYSQLTest.main(MYSQLTest.java:53)
 Caused by: java.lang.NullPointerException
       at com.mysql.jdbc.ConnectionImpl.getServerCharacterEncoding(ConnectionImpl.java:3281)
       at com.mysql.jdbc.MysqlIO.sendConnectionAttributes(MysqlIO.java:1940)
       at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1866)
       at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1252)
       at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2488)
       at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2521)
       ... 13 more



4.
 java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
       at com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:1079)
       at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3595)
       at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2536)
       at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2306)
       at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:839)
       at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
       at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
       at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:421)
       at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:350)
       at java.sql.DriverManager.getConnection(DriverManager.java:571)
       at java.sql.DriverManager.getConnection(DriverManager.java:215)
       at MYSQLTest.main(MYSQLTest.java:53)
 Caused by: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
       at com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:1024)
       ... 15 more


Expected results:


Additional info:

Comment 2 Jakub Jančo 2018-11-05 14:17:42 UTC
mariadb-java-client 2.2.5 is working with MySQL server 8.0.{12,13}.


Note You need to log in before you can comment on or make changes to this bug.