【 TiDB 使用环境】
服务器:centos 7.6 16vCPU 64G内存 2T硬盘
TIDB版本:5.7.25-TiDB-v5.2.2
【概述】 场景 + 问题概述
SELECT NOW(); 查询系统时间显示不对
然后查询了系统时间,显示是newyork
SHOW GLOBAL VARIABLES LIKE ‘%system_time_zone’;
system_time_zone America/New_York
使用set命令设置完时区后,time_zone显示正常,NOW()正常,但是system_time_zone还是不对
SET time_zone = ‘Asia/Shanghai’;
SHOW GLOBAL VARIABLES LIKE ‘time_zone’;
time_zone Asia/Shanghai
查询到这个参数是只读的,文档中显示这个数据是从服务器读取的,但是服务器的时间是对的,时区也是shanghai;
--------服务器执行命令:timedatectl
Local time: Tue 2022-01-11 17:00:46 CST
Universal time: Tue 2022-01-11 09:00:46 UTC
RTC time: Tue 2022-01-11 17:01:26
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: yes
DST active: n/a
Warning: The system is configured to read the RTC time in the local time zone.
This mode can not be fully supported. It will create various problems
with time zone changes and daylight saving time adjustments. The RTC
time is never updated, it relies on external facilities to maintain it.
If at all possible, use RTC in UTC by calling
‘timedatectl set-local-rtc 0’.
【问题】 当前遇到的问题
这个时间是从哪里读取的,这个问题有哪些影响?怎么解决?