show processlist;
show variables like ‘%log_output%’;
show variables like ‘%general_log%’;
SET GLOBAL log_output = ‘TABLE’; // 慢日志输出到表中
SET GLOBAL general_log = ‘ON’; //日志开启
SET GLOBAL log_output = ‘FILE’; // 慢日志输出到文件中
SET GLOBAL general_log = ‘OFF’; //日志关闭
show variables like ‘general_log_file’;
注意:在查询到所需要的记录之后,应尽快关闭日志模式,日志积累会很快占用较大磁盘空间