[SOLVED] Mysql persist error

I get this error…how can i solve it???

Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: 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.

1 Like

Using the forum search feature, I searched for cest and found this

Hi,
I could solve this problem by :
Changing the code of MysqlPersistenceService.java :

I added :

private String servertimezone;

and

   tmpString = (String) config.get("servertimezone");
    if (StringUtils.isNotBlank(tmpString) && StringUtils.isNotBlank(url)) {
        url += "?useLegacyDatetimeCode=false&serverTimezone=" + tmpString;
    }

and adding in mysql.persist :

servertimezone=Europe/Paris

Even easiest to do :
Update url value in mysql.cfg to something like :
url=jdbc:mysql://mysqlserverHost:3306/mydb?useLegacyDatetimeCode=false&serverTimezone=Europe/Paris

I get the same error since the 1st of April as the CEST has to do with the summer time …
I have added the extension like shown below (in my case the serverTimezone=Europe/Berlin)

but I get still the error message … the only different is that my HABPanel seems to get at least contact again and sporadically I see new data stored in my MariaDB v10.

The config change does not seem to really solve my problem completely …
Any idea whatelse could be wrong?

Everything worked fine before time change to summer time …

EDIT:
I added an additional parameter to my mysql.cfg:

default_time_zone='Europe/Berlin'

and after this the issue is gone !

Any idea about which jdbc client version you are using ?

No, I must admit that I am not so talented to look that up without assistance …
Let me see if there is any commands to be found in the community as I have the additional challenge of running OH (in version 2.5 - Milestone 1) in a docker container where all the directory paths are different from a “normal” installation … Let me see what I can find out. But it seems that I at least found a workaround.

EDIT:

I think, I still use MySQL directly and no JDBC as PaperUI shows only:

See the post
https://community.openhab.org/t/solved-after-reboot-no-connection-to-mysql-database/70023/5