MySQL连接器错误“服务器时区值中欧时间"; [英] MySQL connector error "The server time zone value Central European Time"
问题描述
我的问题
MySQL连接器服务器时区值中部欧洲时间"无法识别或代表多个时区.
MySQL connector "The server time zone value Central European Time" is unrecognized or represents more than one time zone.
项目
具有以下内容的小型Web项目: JavaEE,Tomcat 8.5,MySQL,Maven
Small web Project with: JavaEE, Tomcat 8.5, MySQL, Maven
我的尝试
- Maven->将MySQL连接器形式6.x更改为5.1.39(不变)
- 编辑context.xml URL更改
context.xml中的连接
Connection in context.xml
URL ="jdbc:mysql://127.0.0.1:3306/rk_tu_lager? useLegacyDatetimeCode = false; serverTimezone = CEST; useSSL = false;
URL="jdbc: mysql://127.0.0.1:3306/rk_tu_lager?useLegacyDatetimeCode=false;serverTimezone=CEST;useSSL=false;
错误:
起因: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: 服务器时区值"Mitteleurop?ische Sommerzeit"无法识别 或代表多个时区.您必须配置 服务器或JDBC驱动程序(通过serverTimezone配置属性) 如果要使用时区,则使用更特定的时区值 支持.
Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value 'Mitteleurop?ische Sommerzeit' 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.
推荐答案
谢谢Mark Rotteveel和Gord Thompson
Thank you Mark Rotteveel and Gord Thompson
我在XML文件中建立了连接,而&
和Europe/Amsterdam
终于可以工作了.
I have the connection in an XML file, with &
and Europe/Amsterdam
finally works.
url="jdbc:mysql://127.0.0.1:3306/rk_tu_lager?useLegacyDatetimeCode=false&serverTimezone=Europe/Amsterdam&useSSL=false"
谢谢你,你很棒
这篇关于MySQL连接器错误“服务器时区值中欧时间";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!