To find out slow queries running for mysql

Sometimes php applications are not tuned up properly. In that case we can track the mysql queries running at very slow speed.

To do this

 

Edit /etc/init.d/mysql

$bindir/mysqld_safe –datadir=$datadir –pid-file=$pid_file >/dev/null 2>&1 &

Add –log-slow-queries=/var/log/slow-queries.log to above line as below.

$bindir/mysqld_safe –datadir=$datadir –pid-file=$pid_file –log-slow-queries=/var/log/slow-queries.log
>/dev/null 2>&1 &

  • 526 Users Found This Useful
這篇文章有幫助嗎?

相關文章

Repair mysql databases

Cpanel provides tools to fix corrupt mysql tables. But if you server does not have control panel...