Created
August 14, 2010 04:54
-
-
Save marshluca/523991 to your computer and use it in GitHub Desktop.
MySQL Log 说明
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MySQL Log 的配置 | |
MySQL内置4种Log: | |
Error Log, General Query Log, Binary Log, Slow Query Log | |
1. Error Log | |
错误日志, 记录MySQL启动、运行、停止过程中出现的错误信息 | |
2. General Query Log | |
记录MySQL客户端连接、查询的细节, 调试的时候很有用, 正式运行的时候最好关闭否则会带来大量磁盘IO | |
可以在my.cnf设置 | |
log = your-path-to-general-log | |
3. Binary Log | |
记录数据的修改, 配置MySQL主从复制时需要打开 | |
4. Slow Query Log | |
记录不用索引的Query和执行时间超过long_query_time指定的秒数的Query | |
可以在my.cnf设置 | |
long_query_time = 5 | |
log-slow-queries = your-path-to-slow-log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment