how to enable --log-slow-queries feature in cpanel ?

Hi!

can any body know how to enable --log-slow-queries mysql feature to log queries that runs slow in cpanel ?

i found the following information on how to enable it. what changes i have to make in it in order to work on cpanel server.



How to log slow queries:

# vi /etc/rc.d/init.d/mysqld

Find this line:
SAFE_MYSQLD_OPTIONS="--defaults-file=/etc/my.cnf"

change it to:
SAFE_MYSQLD_OPTIONS="--defaults-file=/etc/my.cnf --log-slow-queries=/var/log/slow-queries.log"

As you can see, we added the option of logging all slow queries to /var/log/slow-queries.log
Close and save mysqld. Shift + Z + Z

touch /var/log/slow-queries.log
chmod 644 /var/log/slow-queries.log

restart mysql
service myslqd restart
mysqld will log all slow queries to this file.

 

 

 

 

Top