sql代码如下:
SET GLOBAL log_output = 'TABLE';SET GLOBAL general_log = 'ON'; -- 开启mysql sql日志
SET GLOBAL log_output = 'TABLE';SET GLOBAL general_log = 'off'; -- 关闭mysql sql日志
truncate table mysql.general_log; -- 删除mysql sql日志记录
SELECT * from mysql.general_log where thread_id=24 ORDER BY event_time DESC; -- 查询mysql sql日志