When checking the slow query, I found that the time was incorrect, which was exactly 8 hours different from the system time. 1. The slow query display time is as follows # Time: 2020-01-10T06:42:24.940811Z 2. System time $ date Fri Jan 10 14:42:31 CST 2020 3. View database parameters mysql> show variables like 'log_timestamps'; +----------------+-------+ | Variable_name | Value | +----------------+-------+ | log_timestamps | UTC | +----------------+-------+ 1 row in set (0.00 sec) As we all know, UTC is the unified universal time, and my current system time is East 8, which is 8 hours ahead of UTC, so it is correct. Check the official documentation for the explanation on the official website. log_timestamps Property Value SYSTEM This variable controls the time zone of timestamps in messages written to the error log, and in general query log and slow query log messages written to files. It does not affect the time zone of general query log and slow query log messages written to tables (mysql.general_log, mysql.slow_log). Rows retrieved from those tables can be converted from the local system time zone to any desired time zone with CONVERT_TZ() or by setting the session time_zone system variable. Permitted log_timestamps values are UTC (the default) and SYSTEM (local system time zone). Timestamps are written using ISO 8601 / RFC 3339 format: YYYY-MM-DDThh:mm:ss.uuuuuu plus a tail value of Z signifying Zulu time (UTC) or ±hh:mm (an offset from UTC). Modifying the parameters can solve the problem. mysql> SET GLOBAL log_timestamps = SYSTEM; Query OK, 0 rows affected (0.00 sec) mysql> SHOW GLOBAL VARIABLES LIKE 'log_timestamps'; +----------------+--------+ | Variable_name | Value | +----------------+--------+ | log_timestamps | SYSTEM | +----------------+--------+ The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Nginx load balancing configuration, automatic switching mode when downtime occurs
>>: Vue Beginner's Guide: Environment Building and Getting Started
mysql copy one table column to another table Some...
VNC is a remote desktop protocol. Follow the inst...
Encapsulate el-dialog as a component When we use ...
1. The difference between forward proxy and rever...
Less is More is a catchphrase for many designers....
There are many reasons for slow query speed, the ...
Table of contents Preface 1. Install scp2 2. Conf...
Set the table's style="table-layout:fixed...
Copy code The code is as follows: .sugLayerDiv{ p...
Ubuntu 16.04 installs the PHP7.0 environment by d...
These introduced HTML tags do not necessarily ful...
Table of contents 1. Introduction 2. Simple defin...
Introduction to Nginx dynamic and static separati...
MySql Null field judgment and IFNULL failure proc...
After MySQL database optimization, not only can t...