今天在配置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 Connect root@localhost on
1 Query select @@version_comment limit 1
150228 10:53:58 1 Query SELECT DATABASE()
1 Init DB huzhicheng
1 Query show databases
1 Query show tables
1 Field List huzc
1 Field List name
1 Field List python
1 Field List t1_mem
1 Field List t2_mem
1 Field List t3
1 Field List t3_mem
1 Field List t_idb_big
1 Field List t_mem
1 Field List t_myisam
1 Field List test
1 Field List test2
1 Field List u1
1 Field List u2
1 Field List u3
1 Field List user
1 Field List v1
1 Field List v2
1 Field List v3
1 Field List v4
1 Field List v5
1 Field List v_merge
150228 10:54:03 1 Query select count(*) from u3
# 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 Connect root@localhost on
1 Query select @@version_comment limit 1
150228 10:53:58 1 Query SELECT DATABASE()
1 Init DB huzhicheng
1 Query show databases
1 Query show tables
1 Field List huzc
1 Field List name
1 Field List python
1 Field List t1_mem
1 Field List t2_mem
1 Field List t3
1 Field List t3_mem
1 Field List t_idb_big
1 Field List t_mem
1 Field List t_myisam
1 Field List test
1 Field List test2
1 Field List u1
1 Field List u2
1 Field List u3
1 Field List user
1 Field List v1
1 Field List v2
1 Field List v3
1 Field List v4
1 Field List v5
1 Field List v_merge
150228 10:54:03 1 Query select count(*) from u3
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26764973/viewspace-1446014/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26764973/viewspace-1446014/