当前位置:网站首页>Mysql应用日志时间与系统时间相差八小时
Mysql应用日志时间与系统时间相差八小时
2022-08-04 09:28:00 【slyybw】
Mysql应用日志时间与系统时间相差八小时
我这以mysql慢查询日志为例,通过查看慢查询日志,发现日志时间与服务器系统时间相差为八小时
原因
系统默认的log_timestamps为UTC,协调世界时,又称世界统一时间、世界标准时间、国际协调时间。
由于英文(CUT)和法文(TUC)的缩写不同,作为妥协,简称UTC。与linux系统时间(本地时间)相差8小时
解决办法
临时解决
mysql> SHOW VARIABLES LIKE 'log_timestamps';
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| log_timestamps | SYSTEM |
+----------------+--------+
1 row in set (0.00 sec)
mysql> SET GLOBAL log_timestamps = SYSTEM;(立即生效,重启mysql服务,失效)
Query OK, 0 rows affected (0.00 sec)
永久解决
在/etc/my.cnf中添加如下一行:
log_timestamps=system
重启服务生效。
边栏推荐
- LVGL's multi-language conversion tool -- a good assistant for font settings
- IDEA 自动导入的配置(Auto import)
- 张朝阳对话俞敏洪:谈宇宙、谈焦虑、谈创业、谈退休、谈人生
- 关于DSP驱动外挂flash
- MindSpore:mirrorpad算子速度过慢的问题
- leetcode经典例题——56.合并区间
- 云函数实现网站自动化签到配置详解【Web函数/Nodejs/cookie】
- 如何快速将Zabbix5.0升级至6.0?
- Win11系统重装用什么好 一键重装Win11教程
- v-model原理,在“radio”、“checkbox”、“select”、修饰符
猜你喜欢

JSP基本语法

LeetCode中等题之旋转图像

leetcode经典例题——49.字母异位词分组

三层交换机配置MSTP协议详解【华为eNSP实验】

Grafana9.0发布,Prometheus和Loki查询生成器、全新导航、热图面板等新功能!
![Detailed explanation of switch link aggregation [Huawei eNSP]](/img/c2/f9797fe8b17a418466b60cc3dc50a1.png)
Detailed explanation of switch link aggregation [Huawei eNSP]

开源一夏 | 查询分页不只有limit,这四种分页方法值得掌握

leetcode动态规划系列(求路径篇)
![cannot import name 'import_string' from 'werkzeug' [bug solution]](/img/ee/c91ec761eb637260d92980a2838a92.png)
cannot import name 'import_string' from 'werkzeug' [bug solution]

Since his 97, I roll but he...
随机推荐
Detailed Explanation of Addresses Delivered by DHCP on Routing/Layer 3 Switches [Huawei eNSP]
MATLAB/Simulink快捷键
Libtomcrypt AES 加密及解密
GBsae 8 c database using an error, how to do?
三层交换机/路由器OSPF配置详解【华为eNSP实验】
什么是元宇宙?
并发编程之生产者和消费者问题
[Punctuality Atomic STM32 Serial] Chapter 1 Learning Method of the Book Excerpted from [Punctuality Atomic] MiniPro STM32H750 Development Guide_V1.1
张朝阳对话俞敏洪:谈宇宙、谈焦虑、谈创业、谈退休、谈人生
蘑菇书EasyRL学习笔记
Detailed explanation of MSTP protocol configuration on Layer 3 switches [Huawei eNSP experiment]
去掉js代码文件所有注释
Win10电脑经常发出叮咚声音怎么关闭
Win11怎么进行左右键对调?
下午14:00面试,14:08低着头出来了 ,问的实在是太...
I am 37 this year, and I was rushed by a big factory to...
学习在php中将特大数字转成带有千/万/亿为单位的字符串
罗克韦尔AB PLC RSLogix5000中定时器指令使用方法介绍
有坦荡的远方
Post-94 Byte P7 posted the salary slip: It's really good to make up for this...