mysql错误: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 value if you want to utilize time zone support.

这是SpringBoot整合MySQL的依赖包版本过高,在高版本的MySQL依赖中数据库和系统时区差异所造成的。系统为SQL默认美国时间,而我们中国要比他们迟8小时,因此将时区设置为当前系统时区即可,采用+8:00格式
两种解决方案
1.降低 mysql-connector-java依赖版本 (使用5.1.x版本即可)
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.35</version>
</dependency>
2.在JDBC连接url后添加时区属性:
&serverTimezone=GMT%2B8
mysql错误:java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone.的更多相关文章
- 【MySQL】java.sql.SQLException: The server time zone value
错误:Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: The se ...
- MySQL连接数据库报时区错误:java.sql.SQLException: The server time zone value
连接MySQL数据库时报以下时区错误信息: java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized ...
- 连接mysql数据库报错java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized...解决方法
今天连接mysql数据库报错如下: java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or r ...
- MySql数据库时区异常,java.sql.SQLException: The server time zone value '?й???׼ʱ?' is unrecognized or represents more than one time zone.
JDBC访问MySql异常 Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException ...
- 解决mysql java.sql.SQLException: The server time zone value‘XXXXXX' is unrecognized or represents...
解决 java.sql.SQLException: The server time zone value 'XXXXXX' is unrecognized or represents more tha ...
- mysql报错:java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.
mybatis链接mysql,启动服务报错: java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecogni ...
- 连接mysql报错java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized...解决方法
报错内容: java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents mo ...
- 解决java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone
使用spring boot整合MySQL时一直报 java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecog ...
- java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ 解决方案
//第一个异常 Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysq ...
随机推荐
- js数组快速排序和冒泡排序
1.快速排序 var arr = [1, 2, 5, 6, 3, 1, 4]; function mySort(arr) { if (arr.length <= 1) { return arr; ...
- 最简单的Go Dockerfile编写姿势,没有之一!
1. Dockerfile一些额外注意点 选择最简单的镜像 比如alpine,整个镜像5M左右 设置镜像时区 RUN apk add --no-cache tzdata ENV TZ Asia/Sha ...
- 题解-[ZJOI2005]沼泽鳄鱼
题解-[ZJOI2005]沼泽鳄鱼 前置知识: 邻接矩阵 矩阵乘法 矩阵快速幂 [ZJOI2005]沼泽鳄鱼 给一个有 \(N\) 个点,\(M\) 条双向边的图 \(G\),其中有 \(NFish\ ...
- MySQL的验证方式
mysql8之后root用户的密码验证方式修改了,mysql8的加密方式为caching_sha2_passoword,而navicat连接所用的方式为native_password. 使用命令mys ...
- git clone GitLab 工程报错Repository not found
有时使用git拉取gitlab上的项目时会出现如下的错误信息:Repository not found remote: Repository not found.fatal: repository ' ...
- WinUI 3 Preview 3 发布了,再一次试试它的性能
1. WinUI 3 在微软 Build 2020 开发者大会上,WinUI 团队宣布可公开预览的 WinUI 3 Preview 1,它让开发人员可以在 Win32 中使用 WinUI.最终 XAM ...
- 使用MySQL Shell创建MGR
本篇知识点: 配置MGR所需的参数 使用MySQL Shell配置MGR shell.connect() var 设定临时变量 dba.createCluster() dba.getCluster() ...
- react第二十单元(react+react-router-dom+redux综合案例2)
第二十单元(react+react-router-dom+redux综合案例2) #课程目标 #知识点 #授课思路 #案例和作业
- 微服务之服务治理_Eureka
首先需要明确,不管是什么事物需要"治理",那一定是该事物存在一定问题.比如环境治理.那么服务,或者说微服务为什么需要治理?对于服务来说,如果它承担的业务职责简单,那其实治理的必要性 ...
- Visual Studio 2013中安装Resharper之后一些快捷键无法使用,比如F6和F12
快捷键是一个很好用的东西,尤其对于计算机从业者来说,好的快捷键能够高程度提高工作效率.像我们程序员经常需要团队开发,我们会遇到一个问题,那就是快捷键不一致问题,我一般会安装resharper,但是有的 ...