"Access denied" in error log upon service start
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Confirmed
|
Low
|
Unassigned | |||
5.6 |
Confirmed
|
Low
|
Unassigned | |||
5.7 |
Invalid
|
Undecided
|
Unassigned |
Bug Description
On CentOS 7 machine with Percona-
With "log-warnings=2" in my.cnf my error log always includes:
[Warning] Access denied for user 'root'@'localhost' (using password: NO)
The warning entry above is emitted upon every start / restart of MySQL service.
I've traced it down to ping check inside /usr/bin/
It seems that mysqladmin (inside that script) doesn't resolve ~/.my.cnf properly (I have credentials for root user stored there).
When supplied HOME variable as "/root" everything works, but I have to override systemctl unit file to do the job as seen here: https:/
Changed in percona-server: | |
importance: | Undecided → Low |
status: | New → Triaged |
tags: | added: pkg |
Verified on 5.6.37-rel82.2.el7. 5.7 is not affected.
mysqladmin is trying to read file ~/my.cnf: "~/.my. cnf", 0x7ffe1f11bcd0) = -1 ENOENT (No such file or directory)
stat(
however, SystemD sets $HOME environment variable only if User directive is set in systemd service.
It can be fixed with adding User=root directive to /etc/systemd/ system/ mysql.service file.
#
# Systemd service file for Percona Server
#
# # This service file is to start PS just with mysqld_safe
#
[Unit] target
User=root
Description=MySQL Percona Server
After=network.
After=syslog.target
[Install] multi-user. target
WantedBy=
Alias=mysql.service
[Service] /usr/bin/ mysql-systemd pre
# Needed to create system tables etc.
ExecStartPre=
# Start main service /usr/bin/ mysqld_ safe
ExecStart=
# Don't signal startup success before a ping works /usr/bin/ mysql-systemd post
ExecStartPost=
# Give up if ping don't get an answer
TimeoutSec=600
Restart=always
PrivateTmp=false