#1072699 /etc/munin/plugin-conf.d/munin-node: mysql_ plugin can't authenticate to server with default configuration

Package:
munin-node
Source:
munin-node
Submitter:
Carsten Leonhardt
Date:
2024-09-23 00:33:01 UTC
Severity:
normal
Tags:
#1072699#5
Date:
2024-06-06 16:59:16 UTC
From:
To:
Dear Maintainer,

the plugin mysql_ fails in the default configuration:

command prompt # munin-run --debug mysql_slow
# Skipping systemd properties simulation due to lack of permissions.
# Processing plugin configuration from /etc/munin/plugin-conf.d/README
# Processing plugin configuration from /etc/munin/plugin-conf.d/dhcpd3
# Processing plugin configuration from /etc/munin/plugin-conf.d/munin-node
# Processing plugin configuration from /etc/munin/plugin-conf.d/mysql
# Processing plugin configuration from /etc/munin/plugin-conf.d/spamstats
# Setting /rgid/ruid/ to /117/0/
# Setting /egid/euid/ to /117 117/0/
# Setting up environment
# Environment mysqlopts = --defaults-file=/etc/mysql/debian.cnf
# Environment mysqlconnection = DBI:mysql:mysql;mysql_read_default_file=/etc/mysql/debian.cnf
# Environment mysqluser = root
# About to run '/etc/munin/plugins/mysql_slow'
DBI connect('mysql;mysql_read_default_file=/etc/mysql/debian.cnf;mysql_connect_timeout=5','root',...) failed: Access denied for user 'root'@'localhost' (using password: YES) at /etc/munin/plugins/mysql_slow line 1090.


changing the environment mysqluser to debian-sys-maint fixes it for me:

# munin-run mysql_slow
Slow_queries.value 1

I've attached a patch.

Regards

Carsten

#1072699#12
Date:
2024-09-23 00:25:04 UTC
From:
To:
This should actually  read `user` from `/etc/mysql/debian.cnf`

It's already there

[client]
host     = localhost
user     = debian-sys-maint
password = ***
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = ***
socket   = /var/run/mysqld/mysqld.sock