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 Benutzer fanden dies hilfreich
War diese Antwort hilfreich?

Verwandte Artikel

Repair mysql databases

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