当前位置:网站首页>You must configure either the server or JDBC driver (via the ‘serverTimezone)
You must configure either the server or JDBC driver (via the ‘serverTimezone)
2022-07-28 05:16:00 【jekyhu】
一、错误信息:
用SpringBoot项目用MyBatis连接数据库报错:You must configure either the server or JDBC driver (via the 'serverTimezone)
二、原因:
因为安装mysql的时候时区设置的不正确 mysql默认的是美国的时区。
三、解决办法:
(1)在数据库名后面加上
?&serverTimezone=Asia/Shanghai如下图:

(2)或者在图形化界面 Navicat Premium 中添加语句:
set global time_zone='+8:00';
如图,问题即可解决。
(3)将 MySQL 版本降低,低版本的则不会出现这种问题。
有时间因为创建的是springboot项目,在pom中添加MySQL依赖,并没有设置版本号,因为springboot内部配置过了。它配置的版本号是8.0.13 就是因为MySQL的版本太高了。
边栏推荐
- [learning record] data enhancement 1
- HDU 2586 How far away ? (LCA multiplication method)
- regular expression
- HDU 3078 network (lca+ sort)
- 【ARXIV2203】Efficient Long-Range Attention Network for Image Super-resolution
- 类和对象【中】
- YUV to uiimage
- Simulink automatically generates STM32 code details
- 2022 summer practice (first week)
- JMeter related knowledge sorting
猜你喜欢

Google browser cannot open localhost:3000. If you open localhost, you will jump to the test address

Eccv2022 | 29 papers of Tencent Youtu were selected, including face security, image segmentation, target detection and other research directions

【CVPR2022】Multi-Scale High-Resolution Vision Transformer for Semantic Segmentation
![[internal mental skill] - creation and destruction of function stack frame (C implementation)](/img/a9/81644ee9ffb74a5dc8ff1bc3977f49.png)
[internal mental skill] - creation and destruction of function stack frame (C implementation)

Reading notes of SMT practical guide 1

MySQL practice 45 lectures
Printf function of input and output function in C language

21 day SQL punch in summary

测试开发---自动化测试中的UI测试

First acquaintance with C language (1)
随机推荐
php7.1 连接sqlserver2008r2 如何测试成功
接口幂等性问题
Duoyu security browser will improve the security mode and make users browse more safely
Check box error
【CVPR2022 oral】Balanced Multimodal Learning via On-the-fly Gradient Modulation
7. < tag string and API trade-offs> supplement: Sword finger offer 05. replace spaces
MySQL practice 45 lectures
【ARXIV2205】Inception Transformer
Data imbalance: comprehensive sampling of anti fraud model (data imbalance)
POJ 2763 housewife wind (tree chain partition + edge weighting point weight)
Dcgan:deep volume general adaptive networks -- paper analysis
jsonp 单点登录 权限检验
HDU 2586 How far away ? (LCA multiplication method)
Share several methods of managing flag bits in C program
【CVPR2022】Multi-Scale High-Resolution Vision Transformer for Semantic Segmentation
[learning record] data enhancement 1
Scanf function of input and output function in C language
【ARXIV2204】Simple Baselines for Image Restoration
Table image extraction based on traditional intersection method and Tesseract OCR
Applet import project