Archive

Archive for July, 2014

Mysql Monitoring

July 17, 2014 Leave a comment

Monitor the queries being run by MySQL:

watch -n 1 mysqladmin –user=<user> –password=<password> processlist

Monitor MySQL threads per user:

mysql -BNe “SELECT user,COUNT(user) AS count FROM processlist GROUP BY user ORDER BY count;” information_schema

 

my.cnf

[mysqld]
….
slow-query-log = 1
slow-query-log-file = /var/log/mysql/localhost-slow.log
long_query_time = 1
log-queries-not-using-indexes

 

Advertisements
Categories: Uncategorized Tags: