Sep 19, 2018

How to change time zone of error log file of MySQL?

log_timestamps 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.

Command-Line Format--log-timestamps=#
System VariableNamelog_timestamps
Variable ScopeGlobal
Dynamic VariableYes
Permitted ValuesTypeenumeration
Valid ValuesUTC

This variable 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).
This variable was 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.