dbdao吧 关注:1,186贴子:4,073
  • 2回复贴,共1

MySQL 5.7 general log中时间和系统时间不一致。

只看楼主收藏回复

广州-ETL-wmsok(494511661) 5/11/2016 1:49:11 PM
时间不一致
刚我执行时是13点
我先把这个这这个的日志清空
然后启动数据库


IP属地:上海1楼2016-05-11 15:26回复
    上海-DBDAO-Biot(biot@qq.com) 5/11/2016 2:05:26 PM
    mysql version
    广州-ETL-wmsok(494511661) 5/11/2016 2:19:49 PM
    [root@RAC1 mysql]# mysqladmin -u root version
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
    [root@RAC1 mysql]# mysqladmin -u root -p version
    Enter password:
    mysqladmin Ver 8.42 Distrib 5.7.12, for Linux on x86_64
    Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    Server version 5.7.12
    Protocol version 10
    Connection Localhost via UNIX socket
    UNIX socket arb/mysql/mysql.sock
    Uptime: 2 min 32 sec
    Threads: 1 Questions: 3 Slow queries: 0 Opens: 106 Flush tables: 1 Open tables: 99 Queries per second avg: 0.019
    上海-DBDAO-Biot(biot@qq.com) 5/11/2016 2:20:53 PM
    5.7 啊。
    广州-ETL-wmsok(494511661) 5/11/2016 2:21:12 PM
    是的,感觉好多的用法都变了
    上海-DBDAO-Biot(biot@qq.com) 5/11/2016 2:21:20 PM
    你看下 show variables like '%log%time%';
    里面有个timestamp的。
    广州-ETL-wmsok(494511661) 5/11/2016 2:22:30 PM
    UTC
    上海-DBDAO-Biot(biot@qq.com) 5/11/2016 2:23:17 PM
    忘记了, 日志里那个T是不是这个意思了。
    那就是UTC了。
    格林威治时间。
    广州-ETL-wmsok(494511661) 5/11/2016 2:24:43 PM
    有可能
    上海-DBDAO-Biot(biot@qq.com) 5/11/2016 2:24:48 PM
    你这时间+8 就是你的13点了。
    广州-ETL-wmsok(494511661) 5/11/2016 2:25:08 PM
    那我怎么改一下了?


    IP属地:上海2楼2016-05-11 15:26
    回复
      上海-DBDAO-Biot(biot@qq.com) 5/11/2016 2:30:46 PM
      配置文件改改看呗。
      上海-DBDAO-Biot(biot@qq.com) 5/11/2016 2:31:39 PM
      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.
      Permitted log_timestamps values are UTC (the default) and SYSTEM (local system time zone).


      IP属地:上海3楼2016-05-11 15:26
      回复