mysql异常之: The server time zone value ‘?D1ú±ê×?ê±??‘ is unrecognized or represents more than one time zone

mysql异常之: The server time zone value ‘?D1ú±ê×?ê±??‘ is unrecognized or represents more than one time zone

连接数据库时显示:

java.sql.SQLException: The server time zone value ‘?D1ú±ê×?ê±??‘ 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.

这是由于时区问题导致的, 只需要更改MySQL的时区即可:

重启mysql, 再次输入: show variables like ‘%time_zone%‘;

如果还是显示time_zone    |     SYSTEM

可能是由于还没有更新缓存导致的, 再次输入: set time_zone=‘+8:00‘;


1

2

3


set global time_zone = ‘+8:00‘; ##修改mysql全局时区为北京时间,即我们所在的东8

set time_zone = ‘+8:00‘; ##修改当前会话时区

flush privileges; #立即生效

  

如果显示Query Ok, 0 rows affected, 那么很可能是已经更新时区成功了

如果以上方法还不可以解决问题, 那么尝试在代码中做调整

jdbc:mysql://127.0.0.1:3306/onestep?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8

重启服务和应用即可

来自为知笔记(Wiz)

原文地址:https://www.cnblogs.com/harsh/p/10851092.html

时间: 2024-10-09 09:11:42

mysql异常之: The server time zone value ‘?D1ú±ê×?ê±??‘ is unrecognized or represents more than one time zone的相关文章

关于MySql升级JDBC架包导致时区问题报错(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 must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want

Exception in thread “main” java.sql.SQLException: The server time zone value ‘?й???????’ is unrecognized or represents more than one time zone.

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) t

java.sql.SQLException: The server time zone value '?й???????' is unrecognized or represents more than one time zone.

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 v

java SSM项目搭建-- 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 找到jdbc 数据库连接字符串, 加上?serverTimezone=UTC ?serverTimezone=UTC <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManager

The server time zone value &#39;?й???????&#39; is unrecognized or represents more than one time zone.

使用了Mysql Connector/J 6.x以上的版本,然后就报了时区的错误 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 s

java.sql.SQLException: The server time zone value ‘?й???????’ is unrecognized or represents more than one time zone.

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 v

MySql数据库时区异常,java.sql.SQLException: The server time zone value &#39;?&#208;&#185;???&#215;&#188;&#202;&#177;?&#39; is unrecognized or represents more than one time zone.

JDBC访问MySql异常 Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### Error querying database.  Cause: java.sql.SQLException: The server time zone value '?D1???×?ê±?' is unrecognized or represents more than one time zon

The server time zone value &#39;&#214;&#208;&#185;&#250;&#177;&#234;&#215;&#188;&#202;&#177;&#188;&#228;&#39; is unrecognized or represents more than one time zone.

今天用mysql连接数据库时,出现The server time zone value '?D1ú±ê×?ê±??' is unrecognized or represents more than one time zone.问题.在伟大的度娘查后,是时区问题. mysql默认的是美国时区,而中国比美国晚8个小时,所以要+8:00 具体步骤: 1) 以管理员身份进入mysql 2) show variables like '%time_zone%'; 3) set global time_zon

WEB项目运行时,多次遇到 The server time zone value &#39;&#214;&#208;&#185;&#250;&#177;&#234;&#215;&#188;&#202;&#177;&#188;&#228;&#39; is unrecognized or represents more than one time zone问题解决办法

最近很多次遇到 The server time zone value '?D1ú±ê×?ê±??' is unrecognized or represents more than one time zone这个问题, java.sql.SQLException: The server time zone value '?D1ú±ê×?ê±??' is unrecognized or represents more than one time zone. You must configure ei