centos下mysql启用通用查询日志和慢查询日志
Syntax for /etc/my.cnf in Red Hat 9:
[mysqld]
log=/var/log/mysql/mysql.log #通用查询日志
long_query_time=2 #慢查询时间,单位秒,默认为10秒
log-slow-queries=/var/log/mysql/log-slow-queries.log #慢查询日志
You must create the file manually and change owners this way:
mkdir /var/log/mysql
touch /var/log/mysql/log-slow-queries.log
touch /var/log/mysql/mysql.log
chown mysql.mysql -R /var/log/mysql
参考:http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html
浙公网安备 33010602011771号