MySQL连接器错误“服务器时区值中欧时间"; [英] MySQL connector error "The server time zone value Central European Time"

查看:120
本文介绍了MySQL连接器错误“服务器时区值中欧时间";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆