Problem Description:
After logging in to MySQL using the installed MySQL Workbench, when you select server log for log viewing, the time of the log is found to be inconsistent with the system time of the current period, such as:
Viewing the current time of the MySQL system shows:
Appearing as above, it is very puzzled, so in the degree Niang asked the big God, found that there is really a panacea can be used:
Reason Description:
In MySQL 5.7 new log_timestamps This parameter, which is mainly control error log, genera log, and so on log display time parameters
By default, the Error_log,slow_log log timestamp defaults to UTC, resulting in inconsistent with the system time, 8 hours from Beijing time
Workaround:
Because Log_timestamps is a global parameter, the set global parameter is directly after login and will be invalidated after reboot.
It is therefore necessary to restart the service to resolve the problem by adding a log_timestamps configuration in the MySQL configuration file [mysqld].
Operation Steps:
1, go to MySQL installation directory to find the My.ini configuration file, open with Notepad, and then add under [mysqld]: Log_timestamps=system, such as:
2. Restart the MySQL service and log into the database again using show globle variables like ' log_timestamps '; command to view, such as:
3, view the generated log information discovery and the system time is consistent, so that the problem is a perfect solution.
Reference Links:
http://blog.csdn.net/hyy_217/article/details/72781614
Mysql-5.7.10 generated log time is inconsistent with system time