Mysql5.7错误日志时间不对的解决办法


MySQL5.7的错误日志时间和系统时间不一致,看起来费劲,查阅官方文档得知MySQL 5.7.2 开始,新增了 log_timestamps 参数,它主要是控制 error log、genera log等日志文件的显示时间参数:
官文如下:

This variable controls the timestamp time zone of error log messages, and of 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 withCONVERT_TZ()or by setting the sessiontime_zonesystem variable.
Permittedlog_timestampsvalues areUTC(the default) andSYSTEM(local system time zone).
Timestamps are written using ISO 8601 / RFC 3339 format:YYYY-MM-DDThh:mm:ss.uuuuuuplus a tail value ofZsignifying Zulu time (UTC) orhh: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 syst开发云主机域名em time zone by default, notUTC. If you want the previous log message time zone default, setlog_timestamps=SYSTEM.

做了如下修改后,显示正常了:


点击(此处)折叠或打开

相关推荐: mysql ibdata文件 误删除 恢复

查到mysqld的pid[mysql@mvxl0782 binlog]$ netstat -nltp|grep mysqld (Not all processes could be identified, non-owned process info will…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

(0)
打赏 微信扫一扫 微信扫一扫
上一篇 06/05 11:57
下一篇 06/05 11:57

相关推荐