RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1584253 1 None None None 2021-01-20 06:05:38 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.