Package: munin-plugins-core Version: 2.0.33-1 Severity: normal Tags: patch Dear Maintainer,
On a freshly installed Debian 9/Stretch system I get: $ sudo munin-run mysql_commands DBI connect('mysql;mysql_read_default_file=/etc/mysql/debian.cnf;mysql_connect_timeout=5','debian-sys-maint',...) failed: Access denied for user 'debian-sys-maint'@'localhost' (using password: NO) at /etc/munin/plugins/mysql_commands line 903. I note that this system is using mariadb-server-10.1 and I have: # cat debian.cnf # Automatically generated for Debian scripts. DO NOT TOUCH! [client] host = localhost user = root password = socket = /var/run/mysqld/mysqld.sock [mysql_upgrade] host = localhost user = root password = socket = /var/run/mysqld/mysqld.sock basedir = /usr On another Debian system using 8/Jessie I use mysql-server-5.5 and I have: $ sudo cat /etc/mysql/debian.cnf # Automatically generated for Debian scripts. DO NOT TOUCH! [client] host = localhost user = debian-sys-maint password = XXXXXXXXXXXX socket = /var/run/mysqld/mysqld.sock [mysql_upgrade] host = localhost user = debian-sys-maint password = XXXXXXXXXXXX socket = /var/run/mysqld/mysqld.sock basedir = /usr On this system the mysql_* munin plugins are working fine. >From /usr/share/doc/mariadb-server-10.1/README.Debian.gz * ROOT USER AUTHENTICATION VIA UNIX SOCKET ========================================== On new installs no root password is set and no debian-sys-maint user is created anymore. Instead the MariaDB root account is set to be authenticated using the unix socket, e.g. any mysqld invocation by root or via sudo will let the user see the mysqld prompt. You may never ever delete the mysql user "root". Although it has no password is set, the unix_auth plugin ensure that it can only be run locally as the root user. The credentials in /etc/mysql/debian.cnf specify the user which is used by the init scripts to stop the server and perform logrotation. This used to be the debian-sys-maint user which is no longer used as root can run directly. If you have start/stop problems make sure that the /etc/mysql/debian.cnf file specifies the root user and no password. Proposed patch: --- /home/rousseau/munin-node 2017-06-15 23:12:53.880266037 +0200 +++ /etc/munin/plugin-conf.d/munin-node 2017-06-15 23:04:19.285684484 +0200 @@ -73,7 +73,7 @@ [mysql*] user root env.mysqlopts --defaults-file=/etc/mysql/debian.cnf -env.mysqluser debian-sys-maint +env.mysqluser root env.mysqlconnection DBI:mysql:mysql;mysql_read_default_file=/etc/mysql/debian.cnf [postfix_mailqueue] This change works for me. -- System Information: Debian Release: 9.0 APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 4.9.0-3-amd64 (SMP w/1 CPU core) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages munin-plugins-core depends on: ii munin-common 2.0.33-1 ii perl 5.24.1-3 Versions of packages munin-plugins-core recommends: ii libnet-snmp-perl 6.0.1-2 Versions of packages munin-plugins-core suggests: pn conntrack <none> ii libcache-cache-perl 1.08-2 ii libdbd-mysql-perl 4.041-2 ii libnet-dns-perl 1.07-1 pn libnet-netmask-perl <none> pn libnet-telnet-perl <none> ii libxml-parser-perl 2.44-2+b1 ii python 2.7.13-2 pn ruby | ruby-interpreter <none> -- no debconf information