当前位置:网站首页>IDEA 配置连接数据库报错 Server returns invalid timezone. Need to set ‘serverTimezone‘ property.
IDEA 配置连接数据库报错 Server returns invalid timezone. Need to set ‘serverTimezone‘ property.
2022-08-05 05:14:00 【运动猿】
IDEA 配置连接数据库报错 Server returns invalid timezone. Need to set ‘serverTimezone’ property.

原因是MySQL驱动中默认时区是UTC,与本地时间(中国)相差八个小时,所以链接不上。
可以用两种方法解决,都是解决时区问题。
1、点开最右侧 Advanced,找到 serverTimezone,在右侧value处填写 GMT,保存即可!(或填写 Asia/Shanghai)

2、也可以在url后添加:?serverTimezone=GMT

3、版本问题:MySQL驱动 8.0.x新版本的需要设置时区,5.1.x 版本的不需要设置时区,可以直接选择5.1.x的版本省掉时区设置(根据需要选择)

都是时区的问题选哪个都可以,并且这几个是很简单的。
还有一个稍微复杂一丢丢的可以看一下这个博客:需要设置好系统环境变量,dos命令设置时区,还需要同步mysql驱动!
边栏推荐
- 第四讲 反向传播随笔
- [Go through 4] 09-10_Classic network analysis
- flink项目开发-flink的scala shell命令行交互模式开发
- What are the characteristics of the interface of the physical layer?What does each contain?
- 【零基础开发NFT智能合约】如何使用工具自动生成NFT智能合约带白名单可Mint无需写代码
- redis复制机制
- 机器学习(二) —— 机器学习基础
- Difference between for..in and for..of
- BFC(Block Formatting Context)
- redis persistence
猜你喜欢

第5讲 使用pytorch实现线性回归

Wise Force Deleter强制删除工具

CAP+BASE

Lecture 3 Gradient Tutorial Gradient Descent and Stochastic Gradient Descent

Geek卸载工具

Flink EventTime和Watermarks案例分析

flink实例开发-batch批处理实例
![[Go through 4] 09-10_Classic network analysis](/img/f2/e6e71869b8ab014cc1eea0537fc2e7.png)
[Go through 4] 09-10_Classic network analysis
![LeetCode: 1403. Minimum subsequence in non-increasing order [greedy]](/img/99/41629dcd84e95eb3672d0555d6ef2c.png)
LeetCode: 1403. Minimum subsequence in non-increasing order [greedy]

【MySQL】数据库多表链接的查询方式
随机推荐
vscode要安装的插件
Distributed and Clustered
el-table鼠标移入表格改变显示背景色
【过一下6】机器视觉视频 【过一下2被挤掉了】
The fourth back propagation back propagation
[Decoding tools] Some online tools for Bitcoin
[Go through 4] 09-10_Classic network analysis
BFC(Block Formatting Context)
flink中文文档-目录v1.4
JSX基础
What are the characteristics of the interface of the physical layer?What does each contain?
学习总结week2_1
浅谈Servlet生命周期
[Go through 3] Convolution & Image Noise & Edge & Texture
What field type of MySQL database table has the largest storage length?
vscode+pytorch使用经验记录(个人记录+不定时更新)
day11-函数作业
LeetCode: 1403. Minimum subsequence in non-increasing order [greedy]
[Redis] Resid的删除策略
数据库实验五 备份与恢复