Mysql-5.7.10 generated log time is inconsistent with system time

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.