微信登录

执行语句 - tail -f xxx.log - 实时监控执行语句

执行语句 - tail -f xxx.log - 实时监控执行语句
  1. 通过tail命令看.log文件,有新语句输出就终端弹上来
  1. 进入mysql
  2. SHOW VARIABLES LIKE "general_log%"; # 查询log地址
  3. SET GLOBAL general_log = "ON"; # 开启
  4. 退出mysql
  5. tail -f xxx.log # 看监控文件
  6. 关闭和清空:
  7. SET GLOBAL general_log = "OFF"; # 关闭
  8. cd 文件目录 # 定位
  9. > filename # 清空文件内容
执行语句 - tail -f xxx.log - 实时监控执行语句