Support Questions
Find answers, ask questions, and share your expertise

Apache ranger uses from JDBC connection string


Hi all,


I am using com.mysql.jdbc.Driver.8.X.XX and it throws an error about that CEST is an unrecognized timezone, now I have resolved that issue for hive, oozie by using jdbc:mysql://"myhost":3306/hive?serverTimezone=UTC as a connection string.

Ranger does not work with that connection string








When I test the database connection it returns "ok", but when I start the service it returns:




2020-06-19 17:48:44,467  [I] DB FLAVOR :MYSQL
2020-06-19 17:48:44,468  [I] --------- Verifying Ranger DB connection ---------
2020-06-19 17:48:44,468  [I] Checking connection..
2020-06-19 17:48:44,468  [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java-8.0.20.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://"myhost"/ranger -u 'ranger' -p '********' -noheader -trim -c \;  -query "select 1;"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SQLException : SQL state: 01S00 java.sql.SQLException: 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. ErrorCode: 0
2020-06-19 17:48:45,328  [E] Can't establish connection!! Exiting..
2020-06-19 17:48:45,328  [I] Please run DB setup first or contact Administrator..




So I think Ranger does not use my connection string but a default one.


Any ideas how to fix this?