MySQLStudy——慢日志 普通日志
慢日志查询(slow log):
日志文件: 记录了执行速度特别慢的SQL语句
开启的步骤:
1. show variables like '%query%';
2. set global long_query_time = 1; 设置慢查询的时间
3. slow_query_log = ON
4. slow_query_log_file = E:\program\mysql-5.6.44-winx64\data\oldboy-slow.log
普通日志记录(general log):
SQL审计 (记录sql的操作语句)
show variables like '%general%';
+------------------+------------------------------------------------+
| Variable_name | Value |
+------------------+------------------------------------------------+
| general_log | ON |
| general_log_file | E:\program\mysql-5.6.44-winx64\data\oldboy.log |
+------------------+------------------------------------------------+
set global general_log = ON;