您的位置:首页 > 产品设计 > UI/UE

JDBC连接错误:The server time zone value '��' is unrecognized or represents more than one time zone.

2020-03-06 18:26 1616 查看

出错信息:

            com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: 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.

错误描述:

           服务器时区值“InclutionEnter”被识别或表示多个时区。如果要使用时区支持,则必须配置服务器或JDBC驱动程序(通过serverTimezone配置属性)以使用更具体的时区值。

 解决方法:

            第一种解决方案

[code] Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/myrount?serverTimezone=UTC", "root", "12345678");

            第二种解决方案

在mysql中设置时区,默认为SYSTEM set global time_zone='+8:00'

 

  • 点赞
  • 收藏
  • 分享
  • 文章举报
qq_35107595 发布了5 篇原创文章 · 获赞 0 · 访问量 110 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐