需要帮助。我在这里查看过堆栈和mysql网站上的主题,这些配置从来都不适合我。我需要启用MySQL慢速查询日志和普通查询日志。我想在我的配置文件中这样做,而不是作为一个SET语句,因为我假设它会在重新启动mysql时重置?
我遗漏了什么?!每个网站都有完全不同的说法..。我使用的是MySQL 5.5.15。这是我当前的配置:
[mysqld]
local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
skip-external-locking
query_cache_limit=8M
query_cache_size=64M
query_cache_type=1
long_query_time=2
slow_query_log_file=/var/log/mysqld.slow.log
max_connections=100
max_user_connections=10
interactive_timeout=20
wait_timeout=20
connect_timeout=6
thread_cache_size=128
key_buffer=16M
key_buffer_size=256M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
read_buffer_size=2M
sort_buffer_size=2M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=4
myisam_sort_buffer_size=64M
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid发布于 2011-09-09 00:04:28
将slow_query_log=1添加到配置文件中。
参考文献
https://serverfault.com/questions/309853
复制相似问题