慢查询日志 与 general_log

 
 
 
 

慢查询日志:

打开慢查询日志:
 set global slow_query_log=on;

输出格式定义:log_output: [file|table]      

FILE:
set global log_output='FILE';
TABLE:
1.set global log_output='TABLE';
2.set global slow_query_log=off;
alter table mysql.slow_log engine=myisam;
3.set global slow_query_log=on;

内容生成过滤

     log_queries_not_using_indexes:没有使用索引查询
log_throttle_queries_not_using_indexes:
每分钟记录到slow log并且未使用索引sql语句的次数




 
原文地址:https://www.cnblogs.com/zengkefu/p/5596035.html