解决:java.sql.SQLException: The server time zone value xxxxx is unrecognized or represents more tha
异常信息:Exception in thread “main” java.lang.RuntimeException: 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.
异常原因:这是因为使用的mysql时区不同,修改为本地时区即可
解决方法一:在代码中更改时区,但这样做治标不治本,每次写代码都要加上去
在代码URL后面加入: ?serverTimezone=GMT%2B8
如:“jdbc:mysql://localhost:3306/mydb?serverTimezone=GMT%2B8”
解决方法二:直接对数据库时区进行修改,这样做还是治标不治本,重启电脑或者服务器后还是会恢复原状
win + R ------》输入cmd
输入mysql账号和密码(其中root为用户名,123456为密码,可根据实际情况填)
mysql -uroot -p123456
查看现在的时区
show variables like ‘%time_zone%’;
修改为本地时区(以中国时区为例:需要在原时区上+8:00)
set global time_zone = ‘+8:00’;
修改成功,若需查看,需关闭命令(cmd)窗口再打开重新查看
解决方法三:直接对MySQL配置文件my.ini文件进行修改,一劳永逸!!!
default-time-zone=’+08:00’
至此,这个问题已完全解决
解决:java.sql.SQLException: The server time zone value xxxxx is unrecognized or represents more tha相关推荐
- 解决mysql java.sql.SQLException: The server time zone value‘XXXXXX' is unrecognized or represents...
报错截图: 中文意思: 无法获取JDBC连接; 嵌套异常是java.sql.SQLException:服务器时区值'???' 无法识别或代表多个时区.如果要使用时区支持,则必须配置服务器或JDBC驱动 ...
- 解决 java.sql.SQLException:The server time zone value xxx is unrecognized 问题
报错问题:Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.j ...
- 连接MySql出现异常解决:java.sql.SQLException: The server time zone value is unrecognized or represents。
QUESTION: java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represent ...
- java.sql.SQLException: The server time zone value‘xxxxxxxx‘ is unrecognized
报错笔记 原因 一.org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with ...
- SQLException: The server time zone value ‘EDT‘ is unrecognized or represents more than one time zone
异常:java.sql.SQLException: The server time zone value 'EDT' is unrecognized or represents more than o ...
- java.sql.SQLException: The server time zone value '???ú±ê×??±??' is unrecognized or represents 解决方法
转载自https://blog.csdn.net/weixin_37577564/article/details/80329775 在JDBC使用的时候有时候会出现java.sql.SQLExcept ...
- JDBC编程可能遇到的错误:java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or ..
文章目录 1.错误提示: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver 2.提示:Loading class com.mysql.jd ...
- java.sql.SQLException: The server time zone value �й���ʱ�� is unrecognized or represents ...
使用springboot 整合mybatis项目启动控制台报错: java.sql.SQLException: The server time zone value '�й���ʱ��' is un ...
- java.sql.SQLException: The server time zone value ‘�й���ʱ��‘ is unrecognized or represent.........
springboot整合mybatis时运行异常: java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecogn ...
- java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ 解决方案
java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ 解决方案 参考文章: (1)java.sql.SQLException: ...
最新文章
- 计算机图形学 区域填充,计算机图形学 区域填充算法的实现
- matplotlib里的fig和ax的区别。
- Android RecyclerView实现横向滚动
- 使用微软分布式缓存服务Velocity Part 3
- 【20171025早】alert(1) to win 练习
- 01 Python变量和数据类型
- 前端学习(3088):vue+element今日头条管理-关于接口的使用(有声版)
- 如何在GPU上产生随机数
- Spring Boot 学习之配置文件 application.yml
- No goals have been specified for this build. You must specify a valid lifecycle phase or a goal.....
- Python强化训练笔记(二)——元组元素的命名
- 计算机网络中传输层传送的是什么,传输层
- [转] 心态是最大的本钱;人无完人,重要的是怎么做人
- java读写二进制文件 移动指针 seek_文件与文件夹操作
- gpgpu学习推荐书籍
- spark-sql总结
- 京东智臻链首推电子营业执照区块链应用场景落地!
- 前端(微信小程序为例)
- 基于java swing的学生学籍管理系统
- bpmn定义之过程自动化