Error server Timezone is unrecognized wildfly 14 Connector/J 8.0.13

Asked

Viewed 434 times

0

I am configuring my environment using wildfly 14.0.1.Final and mysql-Connector-java-8.0.13.

I have the following error when I set up the Connection profile and do a connection test:

java.sql.Sqlexception: The server time zone value 'Brazilian daylight saving time' 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.

My datasource in the standalone.xml file:

<datasource jndi-name="java:jboss/datasources/MySQL-DS" pool-name="MySQL" enabled="true" use-java-context="true">
  <connection-url>jdbc:mysql://localhost:3306/pegasus?useTimezone=true&amp;serverTimezone=Brazil/East</connection-url>
  <driver>mysql</driver>
  <security>
    <user-name>pegasus_admin</user-name>
      <password>pegasus_admin</password>
  </security>
</datasource>

2 answers

1


Mysql, when it does not have a default Timezone, tries to get the Windows Timezone, but this Timezone is in a format that it does not recognize.

Fix for the problem, set the server’s global time_zone variable.

SET @@global.time_zone = '+3:00';

-1

Depending on your Mysql version, try using it like this:

<connection-url>jdbc:mysql://localhost:3306/pegasus?useTimezone=true&amp;serverTimezone=UTC</connection-url>

Or so

<connection-url>jdbc:mysql://localhost:3306/pegasus?useLegacyDatetimeCode=false;useTimezone=true&amp;serverTimezone=UTC</connection-url>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.