异常之: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.

简介: 在 MySQL 中执行命令试下:  set global time_zone=’+8:00’   设置为东8区 就不报错了。 show variables like '%time_zone%';   解释:在访问数据库时出现时区无法识别问题,在通过在数据库连接URL后,加上?serverTimezone=UTC , 时区是确认了但是这默认是0市区,导致在存入数据库时,JDBC会将当前系统市区东8区,减去8个小时,最终导致时间不匹配。

在 MySQL 中执行命令试下: 


set global time_zone=’+8:00’ 


这里写图片描述 
设置为东8区

就不报错了。

show variables like '%time_zone%';

 

解释:在访问数据库时出现时区无法识别问题,在通过在数据库连接URL后,加上?serverTimezone=UTC , 时区是确认了但是这默认是0市区,导致在存入数据库时,JDBC会将当前系统市区东8区,减去8个小时,最终导致时间不匹配。

目录
相关文章
|
Java 关系型数据库 MySQL
The server time zone value ‘?й???’ is unrecognized or represents more than one time zone. You must c
报错信息如下: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.
92 0
|
6月前
|
Java 数据库连接 数据库
The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time zone
The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time zone
37 0
|
6月前
|
测试技术
Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded 的解决办法
Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded 的解决办法
235 0
|
6月前
|
数据库连接
数据库连接的时区问题 The server time zone value is unrecognized
数据库连接的时区问题 The server time zone value is unrecognized
96 0
|
关系型数据库 MySQL PostgreSQL
PSQLException: 错误: 函数 date_format(timestamp without time zone, unknown) 不存在
PSQLException: 错误: 函数 date_format(timestamp without time zone, unknown) 不存在
309 0
|
关系型数据库 MySQL Java
超详解The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents more than one time zone
超详解The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents more than one time zone
688 0
|
数据库连接 数据库
The server time zone value ‘‘ is unrecognized or represents more than one time zone.
The server time zone value ‘‘ is unrecognized or represents more than one time zone.
|
关系型数据库 MySQL Java
The server time zone value '?й???????' is unrecognized or represents more than one time zone.
The server time zone value '?й???????' is unrecognized or represents more than one time zone.
90 0
The server time zone value '?й???????' is unrecognized or represents more than one time zone.
|
关系型数据库 MySQL Java
The server time zone value ‘锟叫癸拷锟斤拷\u05FC时锟斤拷‘ is unrecognized or represents more than one time zone
The server time zone value ‘锟叫癸拷锟斤拷\u05FC时锟斤拷‘ is unrecognized or represents more than one time zone
The server time zone value ‘锟叫癸拷锟斤拷\u05FC时锟斤拷‘ is unrecognized or represents more than one time zone