- 解决:CannotAcquireResourceExceptio
- ORA-08004: sequence SEQ_T_CUSTOM
- java开发过程中常见问题及解决方案
- Caused by: java.sql.SQLException
- Data truncated for column 'id' a
- Mybatis 第一个程序-各种坑篇Cannot find cl
- Caused by: java.sql.SQLException
- Caused by: java.sql.SQLException
- Caused by: java.sql.SQLException
- Caused by: java.sql.SQLException
问题描述
项目启动出现异常信息:
Caused by: java.sql.SQLException: The server time zone value 'EDT' 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 -u root -p
show variables like "%time_zone%";
显示如下:
[图片上传失败...(image-3ff36-1654767208010)]
mysql默认使用了系统时区,查看当前的系统时区,可以发现当前的Time zone为EDT时区
解决方法
修改mysql全局时区为北京时间,即我们所在的东8区
依次执行命令
set global time_zone = '+8:00';
set time_zone = '+8:00';
flush privileges';
永久生效,可以在配置文件中添加配置
[mysqld]
default-time-zone='+08:00'
原文:https://blog.csdn.net/qq_34383510/article/details/125164285?spm=1001.2014.3001.5502
网友评论