我的编程空间,编程开发者的网络收藏夹
学习永远不晚

The server time zone value

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

The server time zone value

The server time zone value

异常描述

Exception in thread "main" java.sql.SQLException: The server time zone value '???ú±ê×??±??' 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.


JDBC连接mysql 用的是.connector.6.0.jar 

问题解决:

String url = "jdbc:mysql://localhost:3306/zdx?serverTimezone=UTC";

在url后面加上?serverTimezone=UTC 

如下:

String url = "jdbc:mysql://localhost:3306/zdx?serverTimezone=UTC";


提示:Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.


这个问题不算错误,只是友好提示,如果不想要,在6.0的jar里,mysql可以自动加载驱动,

也即是

Class.forName("com.mysql.jdbc.Driver");这句话注释掉就不会再出现这个提示。



免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

The server time zone value

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

报错:The server time zone value ‘�й���׼ʱ��‘ is unrecognied

报错:The server time zone value ‘�й���׼ʱ��’ is unrecognied 当我们通过JDBC连接数据库的时候有时候会报出以下的错误: The server time zone value ‘�й�
2023-08-18

超详解The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents more than one time zone

1.问题分析 2.解决方案 使用的数据库是MySQL,驱动是8.0.22, 这是由于数据库和系统时区差异所造成的,MySQL8以上的驱动要求声明时区, 在jdbc连接的url后面加上serverTimezone=GMT即可解决问题, 如果
2023-08-20

ORA-30072: invalid time zone value ORACLE 报错 故障修复 远程处理

文档解释ORA-30072: invalid time zone valueCause: The value specified for the time zone string, which appears in ALTER
ORA-30072: invalid time zone value ORACLE 报错 故障修复 远程处理
2023-11-05

ORA-30094: failed to find the time zone data file for version string in $ORACLE_HOME/oracore/zoneinf

文档解释ORA-30094: failed to find the time zone data file for version string in $ORACLE_HOME/oracore/zoneinfoCause: There
ORA-30094: failed to find the time zone data file for version string in $ORACLE_HOME/oracore/zoneinf
2023-11-05

ORA-39353: Data was not imported for string. Cannot locate the time zone version string file. ORACLE

文档解释ORA-39353: Data was not imported for string. Cannot locate the time zone version string file.Cause: This table
ORA-39353: Data was not imported for string. Cannot locate the time zone version string file. ORACLE
2023-11-05

ORA-27619: Smart I/O failed because of an internal error when determining the time zone file version

文档解释ORA-27619: Smart I/O failed because of an internal error when determining the time zone file version. Error code
ORA-27619: Smart I/O failed because of an internal error when determining the time zone file version
2023-11-05

ORA-55308: invalid time zone string for lexical value string ORACLE 报错 故障修复 远程处理

文档解释ORA-55308: invalid time zone string for lexical value stringCause: The time zone of this lexical value was
ORA-55308: invalid time zone string for lexical value string ORACLE 报错 故障修复 远程处理
2023-11-05

ORA-56939: failed to unload the secondary time zone data file ORACLE 报错 故障修复 远程处理

文档解释ORA-56939: failed to unload the secondary time zone data fileCause: Attempt to unload the secondary timezone data
ORA-56939: failed to unload the secondary time zone data file ORACLE 报错 故障修复 远程处理
2023-11-05

ORA-56937: failed to load the secondary time zone data file ORACLE 报错 故障修复 远程处理

文档解释ORA-56937: failed to load the secondary time zone data fileCause: Attempt to load the secondary timezone data file
ORA-56937: failed to load the secondary time zone data file ORACLE 报错 故障修复 远程处理
2023-11-05

ORA-02853: Invalid server list latch time out value ORACLE 报错 故障修复 远程处理

文档解释ORA-02853: Invalid server list latch time out valueCause: The time given was not a positive number.Action: Use a
ORA-02853: Invalid server list latch time out value ORACLE 报错 故障修复 远程处理
2023-11-04

编程热搜

目录