启动sql记录日志功能
SET GLOBAL log_output = 'TABLE'; SET GLOBAL general_log = 'ON';
关闭sql记录日志功能
SET GLOBAL log_output = 'FILE'; SET GLOBAL general_log = 'OFF';
查询sql记录
SELECT * from mysql.general_log where argument like '%kg_ah%' ORDER BY event_time DESC;
删除表中的日志
truncate table mysql.general_log;
查看表大小
select TABLE_NAME,data_length/1024/1024 as len from information_schema.
TABLES
order by len desc
网友评论