//开启
SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 'ON';
//查看
SELECT * FROM mysql.general_log ORDER BY event_time DESC;
//关闭
SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 'OFF';
为了方便查看可以使用table//开启SET GLOBAL log_output = 'TABLE';SET GLOBAL general_log = 'ON';//查看SELECT * FROM mysql.general_log ORDER BY event_time DESC;//关闭SET GLOBAL log_output = 'TABLE'; SET GLOBAL general_log = 'OFF';