#866 new defect

MySQL munin plugin: connection problems for 5.0.89

Reported by: yonas Owned by: nobody
Priority: normal Milestone: Munin 2.0.0
Component: plugins Version: 1.4.3
Severity: normal Keywords:
Cc:

Description

I created a user "munin" with SUPER privileges. I get connection problems unless I grant a random privilage for "munin" on the "mysql" database (very strange....).

root# munin-run mysql_innodb_tnx

DBI connect('mysql;mysql_connect_timeout=5','munin',...) failed: Access denied for user 'munin'@'localhost' to database 'mysql' at /etc/munin/plugins/mysql_innodb_tnx line 876
[mysql*]
env.mysqladmin /usr/bin/mysqladmin
env.mysqluser munin
env.mysqlpassword xxxxxxxxx

Once it works at least once, I change remove all the extra privilages I gave it for "mysql" database, and the plugin will continue to work. If I restart mysql server, the connection is dropped and I have to repeat this process.

Change History (4)

comment:1 Changed at 2010-02-24T16:12:19+01:00 by knan

It will probably work if you add

env.mysqlconnection DBI:mysql:<yourdatabasename here>

... the default connection string connects to the "mysql" database. You need privileges to connect to a random database on the server (not necessarily "mysql"), due to how DBD::mysql works.

Try it and report back?

comment:2 Changed at 2010-02-24T17:34:46+01:00 by yonas

Ahh, that could work. That's how I setup the older mysql_ plugin, which didn't have connect problems.

comment:3 Changed at 2010-02-27T04:30:40+01:00 by yonas

Worked! :) I created a new database and gave the user "munin" all privilages to that db, as well as giving SUPER privileges.

This needs to be better documented, though. I'd suggest explaining that, when connecting with a non-root user,

a) a simple privilege, such as SELECT, on the "mysql" db will suffice.

env.mysqluser <your username here>
env.mysqlpassword <your password here>

or

b) create a new db, assign all privileges to that db only to your "munin" user, and change the connection string:

env.mysqlconnection DBI:mysql:<your databasename here>
env.mysqluser <your username here>
env.mysqlpassword <your password here>

comment:4 Changed at 2010-02-27T04:34:08+01:00 by yonas

Worked! :) I created a new database and gave the user "munin" all privilages to that db, as well as giving SUPER privileges.

This needs to be better documented, though. I'd suggest explaining that, when connecting with a non-root user,

a) a simple privilege, such as SELECT, on the "mysql" db will suffice.

env.mysqluser <your username here>
env.mysqlpassword <your password here>

or

b) create a new db, assign all privileges to that db only to your "munin" user, and change the connection string:

env.mysqlconnection DBI:mysql:<your databasename here>
env.mysqluser <your username here>
env.mysqlpassword <your password here>

Note: See TracTickets for help on using tickets.