Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

According to several tutorials, the following should work:

Create a new user in MySQL.

$ mysql -uroot -p
> CREATE USER 'munin'@'localhost';
> exit;

Use that user in munin to access the database: edit /etc/munin/plugin-conf.d/munin-node. At [mysql*] set the following:

env.mysqlopts -u munin

Strange thing, is that running

 /usr/sbin/munin-node-configure --suggest | grep mysql

Which tells me that MySQL cannot access the database and that it tries to access the database using user root:

[DBI connect('mysql;mysql_connect_timeout=5','root',...) failed: Access denied for user 'root'@'localhost' (using password: NO)

This is a CentOS 5.5 machine.

Why should munin-node-configure ignore the setting in /etc/munin/plugin-conf.d/munin-node? Should I set this elsewhere? Reloading or restarting the munin-node deamon changes nothing either.

share|improve this question
up vote 1 down vote accepted

for me wildcards didnt seem to work either but the following did work

env.mysqlopts -u dev1
share|improve this answer
Thanks. Tried that, but it did not solve anything. to me, it looks like the configuration file is not loaded at all. – berkes May 12 '11 at 7:57
This answer brought me on track. It turns out that munin-node-configure somehow ignores the settings in [mysql_queries], but once enabled and restarted the sensor /does/ turn up data. – berkes May 17 '11 at 14:15

For Munin 1.4.7 there is error in documentation: mysql plugin looks for environment variables using another name.

You can check /usr/share/munin/plugins/mysql_

my %config = (
    'dsn'        => $ENV{'mysqlconnection'} || 'DBI:mysql:mysql',
    'user'       => $ENV{'mysqluser'}       || 'root',
    'password'   => $ENV{'mysqlpassword'}   || '',

So because the script doesn't check 'mysqlopts' I had to set up

env.mysqluser username
env.mysqlpassword pass

then restart munin-node (just to be on the safe side).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.