Which script is trying to login to MySQL

wattie

Verified User
Joined
May 31, 2008
Messages
1,234
Location
Bulgaria
In the MySQL error log I get lots of these:

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

It's coming from localhost. It does not show which script is trying to login. How can I find out?
 
Hello,

I guess only through a manual scan... search

If 'user' is an unique name (masked here) then you could probably start with grep and search mysql_connect through the files of the user.

And/or compare time of the logged lines against GET/POST requests from Apache/Nginx logs, and crontasks...
 
Sadly it's not masked. If it was a real username, I would know. It's trying to do anonymous login (without user and pass) :(
 
Got probably similar error in error.log of Apache:

Code:
AH01071: Got error 'PHP message: PHP Warning:  mysql_real_escape_string(): Access denied for user ''@'localhost' (using password: NO)

so you might want to use grep and search the error through apache webserver error logs.

In my case the error introduced after migrating to PHP 7.2.
 
Back
Top