Mysql错误:The server time zone value is unrecognized or represents more than one time zone
2017-04-05 14:34
901 查看
编程访问Mysql数据库时,报出时区错误如下:
通常有以下两种解决方法:
在数据库连接语句后添加?serverTimezone=UTC,即默认0时区,但是要注意,该语句需要跟在数据库连接语句的第一个位置,否则会报错,例如:
修改Mysql的时区为东8区,执行如下命令即可:
The server time zone value '�й�' is unrecognized or represents more than one time zone ...
通常有以下两种解决方法:
在数据库连接语句后添加?serverTimezone=UTC,即默认0时区,但是要注意,该语句需要跟在数据库连接语句的第一个位置,否则会报错,例如:
jdbc.url=jdbc:mysql://localhost:3306/testdatabase?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8 注意:这种方法会存在一个问题,在向数据库插入时间字段时,时间会比当前时间早8小时,即当前系统时间减8小时。
修改Mysql的时区为东8区,执行如下命令即可:
set global time_zone='+8:00'
相关文章推荐
- mysql出现错误:The server time zone value is unrecognized or represents more than one time zone
- Mysql错误:The server time zone value is unrecognized or represents more than one time zone
- mysql连接异常:The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zo
- The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You mu
- The server time zone value 'PDT' is unrecognized or represents more than one time zone
- The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You m
- bug: 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. You mu
- The server timezone value 'UTC' is unrecognized or represents more than one timezone
- 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.
- The server time zone value 'EDT' is unrecognized or represents more than one time zone.
- 数据库连接 The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone.
- The server timezone value 'xxx' is unrecognized or represents more than one time
- 连接数据库:ERROR: The server time zone value '�й�' is unrecognized or represents more than one time zone
- jdbc连接数据库 The server time zone value '�й���ʱ��' is unrecognized or represents more... 错误
- 【问题解决:时区】连接MySQL时错误The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone
- 连接MySQL时区bug: The server time zone value '�й���ʱ��' is unrecognized or represents more
- 异常:java.sql.SQLException: The server time zone value '?й???????' is unrecognized or represents more
- java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents more tha