recently tested MySQL 5.7.21 Community Server This version of the MySQL database, the time to find its error log is inconsistent with the current time of the system, the later check found that the date and time format is UTC time, check the relevant information, originally in MySQL 5.7.2 The timestamp in the log file is then changed from the default Local system time zone to the UTC format. MySQL 5.7.2 more than one parameter log_timestamps, this parameter is mainly to control the error log, slow query log, such as the display time in the log. However, it does not affect the display time of the query log and slow log writes to the table (Mysql.general_log, Mysql.slow_log). When querying records, you can use the Convert_tz () function or set the session-level system variable Time_zone to convert to the desired time zone. The official details are as follows:
 
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's general query log and slow query log messages written to tables (Mysql.general_log, Mys Ql.slow_log). Rows retrieved from those tables can is 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 is UTC (the default) and SYSTEM (local SYSTEM time zone).
Timestamps is 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 (a offset from UTC).
This variable is added in MySQL 5.7.2. Before 5.7.2, timestamps in log messages were written using the local system time zone by default, not UTC. If you want the previous log message time zone default, set Log_timestamps=system.
This parameter is global, can be modified dynamically, the value of modifying parameter log_timestamps is very simple, as shown below, but it is better to set this parameter value in the parameter file my.cnf in case the MySQL service restart fails.
like ' Log_timestamps ';
+----------------+-------+
Value |
+----------------+-------+
| Log_timestamps | UTC |
+----------------+-------+
Row inch Set (0.01 sec)
Set Global Log_timestamps=system;
rows Affected (0.00 sec)
like ' Log_timestamps ';
+----------------+--------+
Value |
+----------------+--------+
| Log_timestamps | SYSTEM |
+----------------+--------+
Row inch Set (0.01 sec)
Mysql>
Resources:
http://mysql.taobao.org/monthly/2017/01/09/
Https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_log_timestamps
MySQL5.7 parameter Log_timestamps