Board index Linux Mysql

Moderator: chandranjoy


Postby chandranjoy » Wed Mar 17, 2010 7:52 pm

How to view MySQL user Privileges:
Enter into mysql prompt,
mysql > SELECT host, user, select_priv, update_priv FROM user WHERE user='teachers';

How to log MySQL slow queries:

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

Find this line:

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.

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.
Site Admin
Posts: 283
Joined: Fri Oct 23, 2009 11:19 pm

Return to Mysql

Who is online

Users browsing this forum: No registered users and 1 guest