Home > Uncategorized > Mysql Monitoring

Mysql Monitoring

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:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: