dbdao吧 关注:1,183贴子:4,074
  • 2回复贴,共1

如何修改mysql日志的时间格式

只看楼主收藏回复

mysql 5.7
日志记录在:/var/log/mysqld.log
但是日志时间显示却要再加8小时才能换算成当地的时间:
2016-04-06T08:20:45.259754Z 0 [Note] InnoDB: PUNCH HOLE support not available
2016-04-06T08:20:45.259805Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-04-06T08:20:45.259816Z 0 [Note] InnoDB: Uses event mutexes
/var/log/mysqld.log
这个要如何改呢,直接显示为系统时间不必再加8转换


1楼2016-04-24 17:10回复
    As of MySQL 5.7.2, the log_timestamps system variable controls the timestamp time zone of messages written to the general query log file (as well as to the slow query log file and the error log). It does not affect the time zone of general query log and slow query log messages written to log tables, but 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. Before MySQL 5.7.2, messages use the local system time zone.
    请查看:


    3楼2016-04-25 17:30
    回复
      2026-01-09 13:04:37
      广告
      不感兴趣
      开通SVIP免广告
      请查看:
      http://dev.mysql.com/doc/refman/5.7/en/query-log.html
      http://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html
      需要对相应time zone表安装数据后,方能使用。


      4楼2016-04-25 17:33
      回复