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 ...
随机推荐
- 冲刺Day5
每天举行站立式会议照片: 前后端交互: 昨天已完成的工作: 1.确认搜索栏界面 2.订单模块的大部分代码 3.用户模块的大部分代码 4.测试登录注册功能 燃尽图: 今天计划完成的工作: 成员 任务 高 ...
- vue 中 this.$options.data() 重置
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Dell R740 使用U盘安装 CentOS7.4 出现Warning:dracut-initqueue timeout - starting timeout scripts解决办法
使用使用UltraISO软碟通刻录U盘,然后在Dell R740服务器安装CentOS7.4会出现如下错误: 解决办法: 1.使用blkid确认U盘的盘符,截图如下: 2.按F11键重启 3.进入启动 ...
- 关于svg格式问题
背景介绍: 在使用photoswipe的时候,引入了css,按钮是使用svg进行展示的,在用vs2010开发调试过程中,发现不能显示按钮.在请求.svg 的文件时,响应头中的content Type始 ...
- Canal监听mysql
安装mysql5.7,并开启binlog 安装mysql 开启binlog find / -name my.cnf 找到这个文件 添加几行 [mysqld] log-bin=mysql-bin # 开 ...
- 图的遍历DFS
图的遍历DFS 与树的深度优先遍历之间的联系 树的深度优先遍历分为:先根,后根 //树的先根遍历 void PreOrder(TreeNode *R){ if(R!=NULL){ visit(R); ...
- 访问控制列表ACL应用
ACL的应用的场景 应用在三层接口 • Nat地址转换 Nat(network address translation,地址转换)是将数据报报头中的ip地址转换为另一个ip地址的过程,主要用于实现内部 ...
- clang-format 数组初始化,多行模式
clang-format 在格式化多行数组的初始化时不够理想.例如 int array[] = { 0, 1, 2 }; 会被格式化为: int array[] = { 0, 1, 2}; 如果在最后 ...
- Restful API 接口设计标准及规范
Restful API 接口设计标准以及规范 RESTful概念 理解和评估以网络为基础的应用软件的架构设计,得到一个功能强.性能好.适宜通信的架构.REST指的是一组架构约束条件和原则." ...
- C#访问Access数据库提示未安装ISAM
解决办法 1.在前面加上Jet OLEDB:,如: Jet OLEDB:Database Password='zt' <add name="ConStrOleDb" conn ...