https://www.jianshu.com/p/2120e38d91db
查询error.log,显示时间为凌晨1点左右

查询系统时间正常

查询数据库内时间正常

查询日志时间戳,发现该设置为UTC
show global variables like 'log_timestamps';

将其修改为系统时间
set global log_timestamps='SYSTEM';


执行操作,查看error.log的变化发现已经生效

作者:飞翔的Tallgeese
链接:https://www.jianshu.com/p/2120e38d91db
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
https://blog.csdn.net/hyy_217/article/details/72781614
因为log_timestamps 是一个GLOBAL的全局参数,所以直接在登录后去set全局参数,重启后就会直接失效
因此需要在mysql的配置文件my.cnf中[mysqld]中增加一条log_timestamps的配置
log_timestamps=SYSTEM