JAVA连接JDBC错误: java.sql.SQLException: The server time zone value ‘�й���׼ʱ��’ is unrecognized or represents more than one time zone.

812次阅读
没有评论

共计 534 个字符,预计需要花费 2 分钟才能阅读完成。

完整错误如下

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.

java.sql.SQLException:服务器时区值 ’ й ‘ 无法识别或代表多个时区。如果要使用时区支持,则必须配置服务器或 JDBC 驱动程序(通过 serverTimezone 配置属性)以使用更具体的时区值。

解决方法:修改 MySQ 的 L 时区

打开 cmd 进去 MySQL,输入下面 4 行代码即可

select curtime();   ## 查看 MySQL 当前时间,当前时区 
set global time_zone = '+8:00'; ## 修改 MySQL 全局时区为东 8 区的北京时间 
set time_zone = '+8:00'; ## 修改当前会话时区 
flush privileges; ## 立即生效 
JAVA 连接 JDBC 错误:java.sql.SQLException: The server time zone value'�й���׼ʱ��'is unrecognized or represents more than one time zone.

正文完
 
Hlynford
版权声明:本站原创文章,由 Hlynford 2019-08-01发表,共计534字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)