mysql 配置 General Query Log和# Slow Query Log

今天在配置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

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26764973/viewspace-1446014/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26764973/viewspace-1446014/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值