A. 设置输入

  1. set global log_output='TABLE'; -- 输出到表
  2. set global log=ON;
  3. select * from mysql.general_log order by event_time desc limit 1000;

B. 删除历史记录

  • truncate table general_log;

C. 关闭

  • set global log=Off;

D. 清空

  • truncate table general_log;