idea连接数据库报错 Server returns invalid timezone. Need to set‘serverTimezone’property

2022/2/4 19:19:12

本文主要是介绍idea连接数据库报错 Server returns invalid timezone. Need to set‘serverTimezone’property,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

idea连接数据库报错 Server returns invalid timezone. Need to set‘serverTimezone’property

在这里插入图片描述
原因是MySQL驱动中默认时区是UTC,与本地时间(中国)相差八个小时,所以链接不上。
在这里插入图片描述

点击Set time zone
在这里插入图片描述
1.在框中填写 GMT,保存即可!(或填写 Asia/Shanghai)在这里插入图片描述
2.也可以在url后添加:?serverTimezone=GMT
在这里插入图片描述

PS:
GMT(Greenwich Mean Time):格林威治标准时间
UTC:世界标准时间
CST(China Standard Time):中国标准时间

GMT + 8 = UTC + 8 = CST



这篇关于idea连接数据库报错 Server returns invalid timezone. Need to set‘serverTimezone’property的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程