当前位置:网站首页>MySQL time, time zone, auto fill 0
MySQL time, time zone, auto fill 0
2022-07-06 12:16:00 【A pole】
Database time update problem 2022/4/13
When the database updates user information , The registration time will be updated every time , I'm really confused about this wave .
At first I thought it was mybatis By the way, I updated the registration time , Then I checked the code , No problem found , open mybatis Look at the log ,sql The statements are also correct , I don't see the code that updates the registration time at all .
Think about it. , Maybe it's the database . It is found that the registration time field is checked Update... Based on the current timestamp The option to , Suddenly understand , The original option is that this field will be updated every time the content is updated . Test the code after canceling , Everything is all right .

Database time zone error 2022/4/20
Today, I debugged an interface , Involving time , I am from Java Get the current time and then go to the database ( In fact, I think using the database now It's fine too ), Then something went wrong , The time saved is several hours slower than the actual time .
I think about it , Will not be new Timestamp(System.currentTimeMillis()); It's a matter of time for this code to get , Tested decisively , Discovery is not its problem , That must be the problem of the database , But I think the time when the database automatically updates the timestamp is correct . Think about it. , Maybe when you turn around , Time zone problem .
Written before yaml When configuring a file , Always follow the teacher's writing , That's what the teacher wrote jdbc:mysql://127.0.0.1:3306/blog?serverTimezone=UTC , It turned out that I was 100 degrees , good heavens , This time zone is the universal time , It's slower than Beijing 8 Hours , Change to serverTimezone=Asia/Shanghai It's settled. .
Database population 0 2022/4/20
stay mysql5.6 in ,int And other digital types can be selected fill 0 .

fill 0 It does not mean that the default value is 0, But to On display , Fill to the left by default 0, namely 20 It will be displayed. 0000000020 , Of course, on the left 0 Not necessarily as much as I wrote , Here I am just making an analogy .
If you don't want to automatically fill so many 0, Cancel... Directly
Fill in zeroThis is the option .
边栏推荐
猜你喜欢

Basic operations of databases and tables ----- modifying data tables

Cannot change version of project facet Dynamic Web Module to 2.3.

Kconfig Kbuild

Mysql database interview questions

Unit test - unittest framework

Working principle of genius telephone watch Z3

Analysis of charging architecture of glory magic 3pro

Custom view puzzle getcolor r.color The color obtained by colorprimary is incorrect

记一次云服务器被密码爆破的经历——关小黑屋、改密码、改端口

Postman 中级使用教程【环境变量、测试脚本、断言、接口文档等】
随机推荐
ES6语法总结--上篇(基础篇)
高通&MTK&麒麟 手機平臺USB3.0方案對比
Analysis of charging architecture of glory magic 3pro
电商数据分析--薪资预测(线性回归)
MP3mini播放模块arduino<DFRobotDFPlayerMini.h>函数详解
I2C bus timing explanation
Understanding of AMBA, AHB, APB and Axi
RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED
Programmers can make mistakes. Basic pointers and arrays of C language
The first simple case of GNN: Cora classification
【ESP32学习-1】Arduino ESP32开发环境搭建
Pytorch实现简单线性回归Demo
记一次云服务器被密码爆破的经历——关小黑屋、改密码、改端口
Working principle of genius telephone watch Z3
嵌入式启动流程
Unit test - unittest framework
Time slice polling scheduling of RT thread threads
History object
Keyword inline (inline function) usage analysis [C language]
C语言回调函数【C语言】