Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #189305 > unrolled thread
| Started by | Rainer Dorsch <ml@bokomoko.de> |
|---|---|
| First post | 2017-11-26 16:00 +0100 |
| Last post | 2017-11-26 20:50 +0100 |
| Articles | 6 — 3 participants |
Back to article view | Back to linux.debian.user
error: 'Access denied for user 'root'@'localhost' (using password: NO)' Rainer Dorsch <ml@bokomoko.de> - 2017-11-26 16:00 +0100
Re: error: 'Access denied for user 'root'@'localhost' (using password: NO)' Ulf Volmer <u.volmer@u-v.de> - 2017-11-26 16:40 +0100
Re: error: 'Access denied for user 'root'@'localhost' (using password: NO)' Joe <joe@jretrading.com> - 2017-11-26 18:10 +0100
Re: error: 'Access denied for user 'root'@'localhost' (using password: NO)' Rainer Dorsch <ml@bokomoko.de> - 2017-11-26 18:50 +0100
Re: error: 'Access denied for user 'root'@'localhost' (using password: NO)' Ulf Volmer <u.volmer@u-v.de> - 2017-11-26 19:20 +0100
Re: error: 'Access denied for user 'root'@'localhost' (using password: NO)' Joe <joe@jretrading.com> - 2017-11-26 20:50 +0100
| From | Rainer Dorsch <ml@bokomoko.de> |
|---|---|
| Date | 2017-11-26 16:00 +0100 |
| Subject | error: 'Access denied for user 'root'@'localhost' (using password: NO)' |
| Message-ID | <uQ6zw-JC-9@gated-at.bofh.it> |
Hello,
I get (daily :-) mails from my cron.daily with the content
Cron <root@scw> test -x /usr/sbin/anacron || ( cd / && run-parts --report /
etc/cron.daily )
/etc/cron.daily/logrotate:
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 '
run-parts: /etc/cron.daily/logrotate exited with return code 1
When I run it locally
root@scw:~# test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/
cron.daily )
root@scw:~#
I do not hit the same issue.
Do I need to specify
· --password[=password], -p[password]
The password to use when connecting to the server. If you use the
short option form (-p), you cannot have a space between the option and the
password. If you omit
the password value following the --password or -p option on the
command line, mysqladmin prompts for one.
Specifying a password on the command line should be considered
insecure.
to get rid of the issue?
Many thanks
Rainer
--
Rainer Dorsch
http://bokomoko.de/
[toc] | [next] | [standalone]
| From | Ulf Volmer <u.volmer@u-v.de> |
|---|---|
| Date | 2017-11-26 16:40 +0100 |
| Subject | Re: error: 'Access denied for user 'root'@'localhost' (using password: NO)' |
| Message-ID | <uQ7cd-1dP-9@gated-at.bofh.it> |
| In reply to | #189305 |
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'm surprised that in the error message above the root user is used. best regards Ulf
[toc] | [prev] | [next] | [standalone]
| From | Joe <joe@jretrading.com> |
|---|---|
| Date | 2017-11-26 18:10 +0100 |
| Subject | Re: error: 'Access denied for user 'root'@'localhost' (using password: NO)' |
| Message-ID | <uQ8Bj-2cJ-1@gated-at.bofh.it> |
| In reply to | #189310 |
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'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. 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. It does on my old mysql-client 5.5.58 installation and my shiny new mariadb-client 10.0.28 but does not on a mysql 5.5 man page found on the Net, and may not be in an early mariadb client, I don't know. -- Joe
[toc] | [prev] | [next] | [standalone]
| From | Rainer Dorsch <ml@bokomoko.de> |
|---|---|
| Date | 2017-11-26 18:50 +0100 |
| Message-ID | <uQ9e1-2rZ-7@gated-at.bofh.it> |
| In reply to | #189313 |
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/
[toc] | [prev] | [next] | [standalone]
| From | Ulf Volmer <u.volmer@u-v.de> |
|---|---|
| Date | 2017-11-26 19:20 +0100 |
| Subject | Re: error: 'Access denied for user 'root'@'localhost' (using password: NO)' |
| Message-ID | <uQ9H3-2Re-11@gated-at.bofh.it> |
| In reply to | #189315 |
On 26.11.2017 18:48, Rainer Dorsch wrote: > 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 That' not the content i expected. But explains you error message. in my system looks like # Automatically generated for Debian scripts. DO NOT TOUCH! [client] host = localhost user = debian-sys-maint password = long_random_string socket = /var/run/mysqld/mysqld.sock [mysql_upgrade] host = localhost user = debian-sys-maint password = long_random_string socket = /var/run/mysqld/mysqld.sock basedir = /usr so i think, you should change the user and password in this file. And also make sure that the user debian-sys-maint exists in the MySQL database and have the configured password. best regards Ulf
[toc] | [prev] | [next] | [standalone]
| From | Joe <joe@jretrading.com> |
|---|---|
| Date | 2017-11-26 20:50 +0100 |
| Subject | Re: error: 'Access denied for user 'root'@'localhost' (using password: NO)' |
| Message-ID | <uQb6a-3F5-13@gated-at.bofh.it> |
| In reply to | #189316 |
On Sun, 26 Nov 2017 19:11:23 +0100 Ulf Volmer <u.volmer@u-v.de> wrote: > On 26.11.2017 18:48, Rainer Dorsch wrote: > > > 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 > > That' not the content i expected. But explains you error message. > > in my system looks like > > # Automatically generated for Debian scripts. DO NOT TOUCH! > [client] > host = localhost > user = debian-sys-maint > password = long_random_string > socket = /var/run/mysqld/mysqld.sock > [mysql_upgrade] > host = localhost > user = debian-sys-maint > password = long_random_string > socket = /var/run/mysqld/mysqld.sock > basedir = /usr > > so i think, you should change the user and password in this file. And > also make sure that the user debian-sys-maint exists in the MySQL > database and have the configured password. > My guess is that this is a mariadb installation. Is that correct? If so, check /usr/share/doc/mariadb-server-10.1/README.Debian.gz "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." Have you previously changed the password of mysql root? -- Joe
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web