MysticRyuujin / guac-install

Script for installing Guacamole on Ubuntu
988 stars 272 forks source link

Required configuration of timezone on mysql for Ubuntu 18.04 LTS #119

Closed jdrews closed 2 years ago

jdrews commented 4 years ago

Just a heads up. I ran into the following problem while using guac-install on Ubuntu 18.04 LTS.

Error querying database. Cause: 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.

The commands that Whitemoon provided fixed it!

https://issues.apache.org/jira/browse/GUACAMOLE-760#

MysticRyuujin commented 4 years ago

Not quite sure how to fix this in an automated/scripted fashion...

jdrews commented 4 years ago

Just in case it gets lost, here's what Whitemoon suggested:

https://issues.apache.org/jira/browse/GUACAMOLE-760?focusedCommentId=16891707&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16891707

After some tests i found a solution that works for me. I use as database server MariaDB (10.1.40-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04).

Execute follow command: mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

Add follow lines into the file /etc/mysql/mariadb.conf.d/50-server.cnf:

[mysqld]
...
# Timezone
default_time_zone=Europe/Berlin
...

Don't forget to adjust the timezone for your environment.

After an restart of the database service (in my case MariaDB), the error is be gone.

jdrews commented 4 years ago

Yeah. I hope that it gets resolved in the source on guacamole. But I figured you should be aware of it (if you weren't already)

graham00 commented 4 years ago

Just in case it gets lost, here's what Whitemoon suggested:

https://issues.apache.org/jira/browse/GUACAMOLE-760?focusedCommentId=16891707&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16891707

After some tests i found a solution that works for me. I use as database server MariaDB (10.1.40-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04). Execute follow command: mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql Add follow lines into the file /etc/mysql/mariadb.conf.d/50-server.cnf:

[mysqld]
...
# Timezone
default_time_zone=Europe/Berlin
...

Don't forget to adjust the timezone for your environment. After an restart of the database service (in my case MariaDB), the error is be gone.

I can confirm this worked for me. Though, my cnf path was instead @:

/etc/mysql/mysql.conf.d/mysqld.cnf

PhilipSchmid commented 4 years ago

Thanks @jdrews! Got my setup working with your fix: https://gist.github.com/PhilipSchmid/b3ab1e2eff7e4482e83d5539d88daa2e#fix-a-timezone-issue