mysql查看执行sql语句的记录日志


开启日志模式

-- 1、设置

-- SET GLOBAL log_output = 'TABLE';SET GLOBAL general_log = 'ON';  //日志开启

-- SET GLOBAL log_output = 'TABLE'; SET GLOBAL general_log = 'OFF';  //日志关闭

-- 2、查询

SELECT * from mysql.general_log ORDER BY event_time DESC;

-- 3、清空表(delete对于这个表,不允许使用,只能用truncate)

-- truncate table mysql.general_log;

 

https://www.cnblogs.com/jhin-wxy/p/8965888.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM