mysql show query log_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 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/,如需转载,请注明出处,否则将追究法律责任。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值