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