查看 MySQL 的操作日志

2020-01-22  本文已影响0人  YUNDONG丶
打开/关闭 日志模式
SET GLOBAL log_output = 'TABLE';SET GLOBAL general_log = 'ON';  //日志开启
SET GLOBAL log_output = 'TABLE'; SET GLOBAL general_log = 'OFF';  //日志关闭
查询日志
SELECT * from mysql.general_log ORDER BY event_time DESC;

注意平时不用时要关闭日志模式。因为记录日志比较占用空间。
___
[扩展内容](http://www.baidu.com)
[github](https://github.com/yundongzhang)
[个人博客](http://yundongis.me)
上一篇 下一篇

猜你喜欢

热点阅读