网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

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

 MySQL 5.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 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.

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

点击(此处)折叠或打开

  1. (root@localhost) [(none)]> show global variables like 'log_timestamps';
  2. +----------------+-------+
  3. | Variable_name | Value |
  4. +----------------+-------+
  5. | log_timestamps | UTC |
  6. +----------------+-------+
  7. 1 row in set (0.01 sec)

  8. (root@localhost) [(none)]> set global log_timestamps=SYSTEM;
  9. Query OK, 0 rows affected (0.00 sec)

  10. (root@localhost) [(none)]> SHOW global variables like 'log_timestamps';
  11. +----------------+--------+
  12. | Variable_name | Value |
  13. +----------------+--------+
  14. | log_timestamps | SYSTEM |
  15. +----------------+--------+
  16. 1 row in set (0.01 sec)





标题名称:Mysql5.7错误日志时间不对的解决办法
文章地址:http://bjjierui.cn/article/jciigp.html

其他资讯