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
# 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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Mysql general query logMySql
- MySQL8.0:The General Query LogMySql
- MySQL Slow Query log(慢查詢日誌)MySql
- ntpdate會導致mysql slow query log出現很大的query timeMySql
- Mysql資料庫Slow_log中的lock_Time和Query_timeMySql資料庫
- coca SLOW QUERY
- Query the duration of log switch
- 利用tcpdump簡易抓取MySQL Query LogTCPMySql
- MySQL slow query [慢查詢] 資料整理MySql
- ELK收集mysql_slow.logMySql
- MySQL:慢SQL(slow_log)MySql
- 開啟 mysql 的 general_logMySql
- 解析MYSQL BINLOG 二進位制格式(3)--QUERY_EVENTMySql
- MySQL slow log相關引數MySql
- [MySQL Slow log]正確安全清空線上慢查詢日誌slow log的流程MySql
- MySQL Query CacheMySql
- mysql之 slow log 慢查詢日誌MySql
- MySQL slow log相關引數解釋MySql
- 官答丨slow_query_log_file例項記憶體中變數與配置檔案設定的不一致記憶體變數
- flashback query和logmnr用於恢復資料的誤刪除(轉)
- MySQL Rewriter Query Rewrite PluginMySqlPlugin
- [Slow log]正確安全清空線上慢查詢日誌slow log的流程
- 【MySQL】Can't get stat of './mysql/slow_log.CSV' (Errcode: 2)MySql
- flashback version query和 flashback transaction query簡單應用
- MySQL error log和bin logMySqlError
- Mysql的redolog和binlogMySql
- mysql 配置log_errorMySqlError
- phpmysqlimysqli_query()mysqli_real_query()PHPMySql
- Sphinx 配置sql_query_killlist解析SQL
- oracle 10g flashback version query 和 flashback transaction query實驗Oracle 10g
- 關於mysql的query_cacheMySql
- proxysql mysql_query_rules 翻譯MySql
- MySQL :Ignoring query to other databaseMySqlDatabase
- Mysql抓包工具 - MySQL Sniffer 使用小結 (含帶general_log日誌)MySql
- MySQL中的redo log和undo logMySql
- mysql relay log和binlog 小結MySql
- MySQL Undo Log和Redo Log介紹MySql
- oracle10g之flashback version query 和flashback transaction query 實驗Oracle