[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: error: 'Access denied for user 'root'@'localhost' (using password: NO)'



On Sonntag, 26. November 2017 17:01:23 CET Joe wrote:
> On Sun, 26 Nov 2017 16:35:24 +0100
> 
> Ulf Volmer <u.volmer@u-v.de> wrote:
> > On 26.11.2017 15:57, Rainer Dorsch wrote:
> > > mysqladmin: connect to server at 'localhost' failed
> > > error: 'Access denied for user 'root'@'localhost' (using password:
> > > NO)' error: error running shared postrotate script for
> > > '/var/log/mysql/mysql.log /
> > > var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log
> > > /var/log/mysql/ error.log '
> > 
> > did you have manual changes in /etc/logrotate.d/mysql-server or
> > /etc/mysql/debian.cnf? in the last file you will find the credentials
> > for the user debian-sys-maint who is used for maintenance tasks.

I am not aware of any change:

root@scw:/etc/logrotate.d# cat mysql-server 
# - I put everything in one block and added sharedscripts, so that mysql gets
#   flush-logs'd only once.
#   Else the binary logs would automatically increase by n times every day.
# - The error log is obsolete, messages go to syslog now.
/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-
slow.log /var/log/mysql/error.log {
        daily
        rotate 7
        missingok
        create 640 mysql adm
        compress
        sharedscripts
        postrotate
          test -x /usr/bin/mysqladmin || exit 0
          if [ -f `my_print_defaults --mysqld | grep -m 1 -oP "pid-file=\K.+$"` 
]; then
            # If this fails, check debian.conf!
            mysqladmin --defaults-file=/etc/mysql/debian.cnf --local flush-
error-log \
              flush-engine-log flush-general-log flush-slow-log
          fi
        endscript
}
root@scw:/etc/logrotate.d#  cat /etc/mysql/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
root@scw:/etc/logrotate.d# 

The only potential candidat I can see is the nextcloud package, which I have 
installed from outside Debian (there is none in Debian), if during the 
installation a change happend I might have missed that.....

> > i'm surprised that in the error message above the root user is used.
> 
> That may suggest a mismatch of versions: the logrotate script uses the
> mysqladmin --defaults-file option, which specifies debian-sys-maint in
> the /etc/mysql/debian.cnf file.

I maybe should have mentioned that it is a stretch machine. I just checked for 
packages not in stretch anymore

root@scw:~# apt-show-versions |grep No
gcc-4.8-base:amd64 4.8.4-1 installed: No available version in archive
gcc-4.9-base:amd64 4.9.2-10 installed: No available version in archive
libapt-pkg4.12:amd64 1.0.9.8.3 installed: No available version in archive
libgnutls-deb0-28:amd64 3.3.8-6+deb8u3 installed: No available version in 
archive
libhogweed2:amd64 2.7.1-5+deb8u1 installed: No available version in archive
libicu52:amd64 52.1-8+deb8u4 installed: No available version in archive
libnettle4:amd64 2.7.1-5+deb8u1 installed: No available version in archive
libprocps3:amd64 2:3.3.9-9 installed: No available version in archive
libpsl0:amd64 0.5.1-1 installed: No available version in archive
libreadline6:amd64 6.3-9 installed: No available version in archive
libssl1.0.0:amd64 1.0.1t-1+deb8u5 installed: No available version in archive
linux-image-4.8.0-1-amd64:amd64 4.8.7-1 installed: No available version in 
archive
root@scw:~#

Nothing suspicious for me.

> Old versions of mysqladmin don't have the --defaults-file option
> defined, so may be looking for the root user. A check of man mysqladmin
> on the offending machine should confirm whether the options include
> --defaults-file.

man mysqladmin contains:

       ·   --defaults-file=filename

           Set filename as the file to read default options from, override 
global defaults files. Must be given as first option.

So I should have that...

Thanks
Rainer


-- 
Rainer Dorsch
http://bokomoko.de/


Reply to: