スロークエリログ

環境はMySQL5.1とする。

/etc/my.cnf を編集

 [mysqld]
 slow_query_log=1
 slow_query_log_file=mysql-slow.log
 long_query_time=1

MySQLプロセスを再起動

 /etc/rc.d/init.d/mysql restart

MySQLにログインし、テストのクエリを発行

 SELECT SLEEP(2);

ログファイルを確認

 tail /var/lib/mysql/mysql-slow.log

参考

http://dev.mysql.com/doc/refman/5.1/ja/slow-query-log.html


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS