开启mysql的监视日志

1、查看监视文件日志开关和日志文件的具体位置:

show global variables like '%general%';

 2、开启监视:

set global general_log=ON;
  也可以设置 日志的保存位置:set global general_log_file='tmp/general.lg'; 
  查看日志的保存位置:show variables like 'general_log_file'; 
3、设置日志时间
我在查询日志的时候发现时间和系统时间不一致;
查看系统默认时间参数:select  @@log_timestamps;

设置使用系统时间:set global log_timestamps=system;

再查看现在的日志时间:

猜你喜欢

转载自www.cnblogs.com/Ternura-1023/p/11592173.html