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.

2 Answers 2


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

env.mysqlopts -u dev1
  • 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, 2011 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, 2011 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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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