Board index Mysql General my.cnf for mysql

How to enable slow querries

Postby a24uall » Thu Aug 02, 2012 2:48 pm

Open my.cnf
vi /etc/my.cnf


Under "[mysqld]" copy the details below :
[mysqld]
log-slow-queries = ON
long_query_time=1
log-slow-queries=/var/lib/mysql/log-slow-queries.log


You must create the file manually and change ownership :

touch /var/lib/mysql/log-slow-queries.log
chown mysql.mysql /var/lib/mysql/log-slow-queries.log


Restart mysql
/etc/init.d/mysql restart

Check the logs :
tail -f /var/lib/mysql/log-slow-queries.log
Arun
WebhostingDevelopment.com
a24uall
Site Admin
 
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am

Re: How to enable slow querries

Postby a24uall » Mon Oct 08, 2012 2:26 pm

Log query when set to 3 the result is as mentioned below :
=====================================================
[email protected] [~]# mysqladmin var | grep long_query_time
| long_query_time | 3.000000 |
[email protected] [~]#
=====================================================
Arun
WebhostingDevelopment.com
a24uall
Site Admin
 
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am


Return to my.cnf for mysql

Who is online

Users browsing this forum: No registered users and 1 guest


cron