今天在配置mysql # Slow Query Log 和 General Query Log 时 实验
# MySQL error log
log_error = /data/errorlog/error.log
log_warnings = 2
# innodb_print_all_deadlocks = 1
# wsrep_log_conflicts = 1 # for Galera only!
# Slow Query Log
slow_query_log_file = /data/errorlog/slow.log
slow_query_log = 1-------------- 只有0和1 0禁止1开启
log_queries_not_using_indexes = 1
long_query_time = 1----查询时间默认设置10秒阀值
min_examined_row_limit = 100
# General Query Log
general_log_file = /data/errorlog/general.log
general_log = 1-------只有0和1 0禁止1开启select country(*) from u3 ; 查询时间为2.86秒
死活 两个日志都不能生成。
关闭selinux 重启机器
再进行查询 General Query Log和# Slow Query Log 同时记录了 两条语句
[root@mysql errorlog]# more slow.log
# Time: 150228 10:54:06
# User@Host: root[root] @ localhost [] Id: 1
# Query_time: 2.600124 Lock_time: 0.000216 Rows_sent: 1 Rows_examined: 4194304
use huzhicheng;
SET timestamp=1425092046;
select count(*) from u3;
[root@mysql errorlog]# more general.log
150228 10:53:54 1 Connectroot@localhost on
1 Queryselect @@version_comment limit 1
150228 10:53:58 1 QuerySELECT DATABASE()
1 Init DBhuzhicheng
1 Queryshow databases
1 Queryshow tables
1 Field Listhuzc
1 Field Listname
1 Field Listpython
1 Field Listt1_mem
1 Field Listt2_mem
1 Field Listt3
1 Field Listt3_mem
1 Field Listt_idb_big
1 Field Listt_mem
1 Field Listt_myisam
1 Field Listtest
1 Field Listtest2
1 Field Listu1
1 Field Listu2
1 Field Listu3
1 Field Listuser
1 Field Listv1
1 Field Listv2
1 Field Listv3
1 Field Listv4
1 Field Listv5
1 Field Listv_merge
150228 10:54:03 1 Queryselect count(*) from u3
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26764973/viewspace-1446014/,如需转载,请注明出处,否则将追究法律责任。