赞
踩
Mysql查询日志默认是关闭状态的。
mysql> show variables like '%general_log%';
+------------------+---------------------+
| Variable_name | Value |
+------------------+---------------------+
| general_log | OFF |
| general_log_file | DESKTOP-0JS7U4E.log |
+------------------+---------------------+
2 rows in set, 1 warning (0.00 sec)
# 开启查询日志
mysql>
mysql> set global general_log = 1;
Query OK, 0 rows affected (0.01 sec)
DESKTOP-0JS7U4E.log
里面的内容记录所有的查询语句。
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe, Version: 8.0.26 (MySQL Community Server - GPL). started with:
TCP Port: 3306, Named Pipe: MySQL
Time Id Command Argument
2024-08-19T13:02:31.525320Z 21 Query SELECT DATABASE()
2024-08-19T13:02:31.525809Z 21 Init DB test
2024-08-19T13:02:36.806746Z 21 Query select * from account
2024-08-19T13:03:22.238296Z 21 Query select * from account
2024-08-19T13:03:23.085120Z 21 Query select * from account
学习交流,知识分享
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。