MySQLでスロークエリログを設定

MySQL

スロークエリログを有効にすると、時間の掛かったクエリをログとして吐き出してくれます。

設定
[root]# vi /etc/my.cnf
[mysqld]
log-slow-queries = mysql-slow.log
long_query_time = 3

再起動
[root]# /etc/init.d/mysql restart

参考サイト:
http://www.nilab.info/zurazure2/000680.html
http://nippondanji.blogspot.com/2009/01/mysql-51.html

コメント

タイトルとURLをコピーしました