打开 MySQL 客户端,开启日志
开启日志
SET GLOBAL general_log = ‘ON’;
> SET GLOBAL general_log = ‘ON’;
Query OK, 0 rows affected (0.00 sec)
设置日志文件
SET GLOBAL general_log_file = ‘x:/mysqlpath/log/mysql.log’;
> SET GLOBAL general_log_file = ‘d:/mysqlpath/mysql/mysql.log’;
Query OK, 0 rows affected (0.00 sec)
ps: 注意,路径分割符须使用 /,而不能使用 \
看日志开启状态
SHOW VARIABLES LIKE “general_log%”;
> SHOW VARIABLES LIKE “general_log%”;
+——————+————————–+
| Variable_name | Value |
+——————+————————–+
| general_log | ON |
| general_log_file | d:/mpath/mysql/mysql.log |
+——————+————————–+
2 rows in set (0.00 sec)
查看日志
记事本(sublimtext)或者baretail.exe,可以选择 Free 版本
转载请注明:XAMPP中文组官网 » windows 监控 MySQL 查询记录