Adding JDBC driver property in SQL Developer connecting to MySQL
I suppose you get it there because this kind of error was properly indexed by Google:
Status : Failure -Test failed: The server time zone value 'CEST' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
However, this trick works if you want to add any property to the JDBC URL string when connecting with Oracle SQL Developer, which provides no other way to add properties.
The trick is JDBC URL Injection after the port. When connecting to port 5501 I set the following in the ‘port’ field:
5501/?serverTimezone=UTC#
like this:
which finally will expand to:
jdbc:mysql://myhost:5501/?serverTimezone=UTC#/information_schema
And get connected probably because of few bugs on both side, so not sure it works on all versions 😎
I added a dummy ‘#’ because the parser includes the ‘/’ if I don’t and I get:
Status : Failure -Test failed: No timezone mapping entry for 'UTC/information_schema'
So, with this additional ‘/?serverTimezone=UTC#’, here is the connection information displayed by a ‘show jdbc’:
-- Database Info --
Database Product Name: MySQL
Database Product Version: 5.7.15-log
Database Major Version: 5
Database Minor Version: 7
-- Driver Info --
Driver Name: MySQL Connector/J
Driver Version: mysql-connector-java-8.0.13 (Revision: 66459e9d39c8fd09767992bc592acd2053279be6)
Driver Major Version: 8
Driver Minor Version: 0
Driver URL: jdbc:mysql://myhost:5501/?serverTimezone=UTC#/information_schema
Driver Location: Unable to parse URL: bundleresource://271.fwk457998670/oracle/jdbc/OracleDriver.class