MySQL Timezone

From LogicalDOC Community Wiki
Jump to navigationJump to search

If you are using MySQL 8 or more recent, you probably have to explicitly define the server's timezone. The symptoms you may note are a 'Database not connected' alert in the login screen and errors like 'Unable to acquire JDBC Connection' in the logs.

You can fix the issue by changing the database connection URL in LogicalDOC or by specifying the timezone in the MySQL configuration.

Change the database connection URL

  • Stop LogicalDOC
  • Open the file <LDOC_HOME>/conf/
  • Locate the setting jdbc.url and append the serverTimezone parameter(eg: jdbc.url=jdbc:mysql://localhost:3306/logicaldoc > jdbc.url=jdbc:mysql://localhost:3306/logicaldoc?serverTimezone=UTC)
  • Save and start LogicalDOC

Change the MySQL configuration

  • Stop MySQL
  • Locale the configuration file (in Linux it is normally in /etc/my.cnf; in Windows it is normally in c:\C:\ProgramData\MySQL\MySQL Server X.X\my.ini)
  • Open it and find the section [mysqld], inside that section add the timezone specification eg: default-time-zone='+01:00'
  • Save and restart MySQL