Wiki source code of "The server timezone value is unrecognized" MySQL Error
Last modified by Eleni Cojocariu on 2026/11/25 14:48
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | XWiki fails to connect to MySQL, and the JDBC driver reports: | ||
| 2 | |||
| 3 | {{code language="none"}} | ||
| 4 | The server timezone value 'CDT' is unrecognized or represents more than one timezone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc timezone value if you want to utilize timezone support. | ||
| 5 | {{/code}} | ||
| 6 | |||
| 7 | === Cause === | ||
| 8 | |||
| 9 | The MySQL JDBC driver asks the server which time zone it runs in, because it converts date and time values between the two, and it needs an answer that identifies exactly one zone. The abbreviation the server returned, ##CDT## in the message above , names more than one, so the driver cannot tell which offset to apply and refuses the connection instead of guessing. XWiki configures no time zone of its own: the requirement belongs to the driver, and either end of the connection can satisfy it. | ||
| 10 | |||
| 11 | === Solution === | ||
| 12 | |||
| 13 | 1. Name the time zone as a connection property in the MySQL block of the ##WEB-INF/hibernate.cfg.xml## file, next to the other connection properties it already sets:((( | ||
| 14 | {{code language="xml"}} | ||
| 15 | <property name="hibernate.connection.serverTimezone">Europe/Berlin</property> | ||
| 16 | {{/code}} | ||
| 17 | ))) | ||
| 18 | 1. Or append it to the connection URL in the same file, which suits an instance that keeps everything in one property:((( | ||
| 19 | {{code language="none"}} | ||
| 20 | jdbc:mysql://localhost:3306/xwiki?serverTimezone=UTC | ||
| 21 | {{/code}} | ||
| 22 | ))) | ||
| 23 | 1. Or give the MySQL server itself an unambiguous time zone, in its own configuration file, so that every client it serves gets a usable answer. | ||
| 24 | 1. Restart XWiki. Any one of the three is enough: the connection is established and the wiki starts normally. |