Mysql Slow Query Logs

hr-ethadmin
Site Admin
Posts: 67
Joined: Fri May 31, 2013 1:04 pm

Mysql Slow Query Logs

Postby hr-ethadmin » Thu Oct 03, 2013 12:38 pm

The slow query log consists of all SQL statements that took more than long_query_time seconds to execute. The time to acquire the initial table locks is not counted as execution time. mysqld writes a statement to the slow query log after it has been executed and after all locks have been released, so log order might be different from execution order. The minimum and default values of long_query_time are 1 and 10, respectively.

log-slow-queries = /var/log/mysqld.slow.log
set-variable = long_query_time=5

Save and then run these commands:

touch /var/log/mysqld.slow.log
chown mysql.mysql /var/log/mysqld.*
/scripts/restartsrv mysql

Return to “Hostripples dedicated Servers (Linux/Windows)”

Who is online

Users browsing this forum: No registered users and 2 guests