"Access denied" in error log upon service start

Bug #1725927 reported by Danila Vershinin on 2017-10-22
6
This bug affects 1 person
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-Server-server-56.x86_64 (5.6.37-rel82.2.el7):

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/mysql-systemd (post function).

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://www.getpagespeed.com/monitoring/mysql/mysqltuner-fix-reduce-eliminate-unclosed-connections-network-issues

Iwo (percona.imp) wrote :

Verified on 5.6.37-rel82.2.el7. 5.7 is not affected.

mysqladmin is trying to read file ~/my.cnf:
    stat("~/.my.cnf", 0x7ffe1f11bcd0) = -1 ENOENT (No such file or directory)

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]
User=root
Description=MySQL Percona Server
After=network.target
After=syslog.target

[Install]
WantedBy=multi-user.target
Alias=mysql.service

[Service]
# Needed to create system tables etc.
ExecStartPre=/usr/bin/mysql-systemd pre

# Start main service
ExecStart=/usr/bin/mysqld_safe

# Don't signal startup success before a ping works
ExecStartPost=/usr/bin/mysql-systemd post

# Give up if ping don't get an answer
TimeoutSec=600

Restart=always
PrivateTmp=false

no longer affects: percona-server/5.7
Iwo (percona.imp) on 2017-11-08
Changed in percona-server:
importance: Undecided → Low
status: New → Triaged

What is 5.5 status?

Iwo (percona.imp) wrote :

5.5 is also affected, verified on 5.5.58-38.10.

tags: added: pkg

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3751

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers