MySQL error log full of [Warning] Access denied for user ''@'localhost' (using password: NO)

stormy

Well-Known Member
Nov 22, 2003
240
59
178
Spain
cPanel Access Level
Root Administrator
I'm trying to fine-tune MySQL and troubleshoot a few issues, so I enabled log-warnings=2. I see that the MySQL error log is full of these:

[Warning] Access denied for user ''@'localhost' (using password: NO)

I suppose it's a user with a misconfigured site/connection. Is there any way to track the source of this?
 

SysSachin

Well-Known Member
Aug 23, 2015
604
49
28
India
cPanel Access Level
Root Administrator
Twitter
You will have to find out all sites MySQL details from site configuration files. Could you please let me know how many sites you have hosted on your server? You can find out all sites databases details through command line using grep or any other command.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello,

The following thread discusses a solution that would help if you want to log this activity in the future:

Access Logs for MySQL

However, note that it's not enabled by default so you won't be able to go back and review past connections.

Thank you.
 

rpvw

Well-Known Member
Jul 18, 2013
1,100
477
113
UK
cPanel Access Level
Root Administrator
Could these connections from an unspecified user be from the service manager checking to see if MySQL is alive ?
 

Esquio

Member
Feb 29, 2016
24
5
53
Spain
cPanel Access Level
Root Administrator
Could these connections from an unspecified user be from the service manager checking to see if MySQL is alive ?
Hi! My server have the same problem. Did you find any solution? It's not an accounts problem, is clearly something on the system.

I have binding to localhost all mysql connections, I flush privileges and many configs on root password, nothing works. Every 3 seconds, 3 rows are written on the log until the infinite:

Code:
2022-02-22 12:43:34 2659 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
2022-02-22 12:43:34 2661 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
2022-02-22 12:43:34 2663 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
2022-02-22 12:43:37 2670 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
2022-02-22 12:43:37 2672 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
2022-02-22 12:43:37 2674 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
At least, how can I rotate the logs or automatically remove these lines?