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

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

问题描述

我的问题

MySQL 连接器服务器时区值中欧时间"无法识别或代表多个时区.

MySQL connector "The server time zone value Central European Time" is unrecognized or represents more than one time zone.

项目

小型网络项目:JavaEE、Tomcat 8.5、MySQL、Maven

Small web Project with: JavaEE, Tomcat 8.5, MySQL, Maven

我的尝试

  • Maven -> 将 MySQL-connector 表单 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天全站免登陆