Make sure that the password in /root/.my.cnf is valid, first.
In /etc/munin/plugin-conf.d , you will see a file called cpanel.conf . Modify it completely to look like so:
[mysql*]
user root
group wheel
env.mysqladmin /usr/bin/mysqladmin
env.mysqlopts -u [MySQL_usr] -p[MySQL_usrpassword]
### [MySQL_usr] is a valid MySQL user and [MySQL_usrpassword] is it’s password
### you can use mysql root too.
[exim_mailqueue]
group mail[exim_mailstats]
group mail[mailman]
user mailman
then restart munin
/etc/init.d/munin-node restart
This tells munin to pull the mysql environment from the file necessary
Of course , in this case you will need munin to run as ROOT. To do this:
su to your munin user
su munin
remove the munin crontab
crontab -e
remove the line, or just add an # to the beginning of it
then exit out of the shell, and add the SAME crontab (that was in the munin user) to root, adding –force-root to the end of the statement, so it’d be something like:
*/5 * * * * /usr/bin/munin-cron --force-root
Thanks Dino, I was having this problem, Mysql on Munin shut down after about a week. Your fix was very straightforward, I appreciate you posting it.