Getting constantly "Access denied for user 'mysql'@'localhost' " - any idea?

hey there,

during the search for another problem i’ve noticed that are many “access denied” entries in the Percona-log (docker) and I can’t get rid of this behavior. Is this something due to this healhcheck? any suggestions?

THX!

{“log”:“Version: ‘5.7.35-38’ socket: ‘/var/lib/mysql/mysql.sock’ port: 3306 Percona Server (GPL), Release 38, Revision 3692a61\n”,“stream”:“stderr”,“time”:“2024-01-12T08:04:37.010811257Z”}

{“log”:“2024-01-12T08:05:06.483898Z 12 [Note] Access denied for user ‘mysql’@‘localhost’ (using password: NO)\n”,“stream”:“stderr”,“time”:“2024-01-12T08:05:06.483981726Z”}

{“log”:“2024-01-12T08:05:36.574398Z 13 [Note] Access denied for user ‘mysql’@‘localhost’ (using password: NO)\n”,“stream”:“stderr”,“time”:“2024-01-12T08:05:36.57451368Z”}

{“log”:“2024-01-12T08:06:06.653369Z 14 [Note] Access denied for user ‘mysql’@‘localhost’ (using password: NO)\n”,“stream”:“stderr”,“time”:“2024-01-12T08:06:06.653461125Z”}

{“log”:“2024-01-12T08:06:36.751475Z 15 [Note] Access denied for user ‘mysql’@‘localhost’ (using password: NO)\n”,“stream”:“stderr”,“time”:“2024-01-12T08:06:36.751574607Z”}

{“log”:“2024-01-12T08:07:06.834954Z 16 [Note] Access denied for user ‘mysql’@‘localhost’ (using password: NO)\n”,“stream”:“stderr”,“time”:“2024-01-12T08:07:06.835039906Z”}

{“log”:“2024-01-12T08:07:36.888664Z 17 [Note] Access denied for user ‘mysql’@‘localhost’ (using password: NO)\n”,“stream”:“stderr”,“time”:“2024-01-12T08:07:36.888746275Z”}

Hello @appfarms_dev, I’m unsure where this is coming from, but you can fix it quickly by creating the user. CREATE USER mysql@localhost;

1 Like

Thx @matthewb,

I’ll will do further investigations and use your “workaround” for now.

Hi appfarms_dev,

The best would be to find out who/what is trying to access MySQL on a regular basis.

if you decide to create the user then you can enable the audit plugin to find out what this user is executing on the server to decide if you either want to remove the user or need to disable some strange process

Regards

In my case it was caused by a container health-check calling the mysqladmin command without a user parameter which defaulted to the container user - mysql and as such database user did not exist it caused these warnings.