Lately the server's been going a bit haywire and we've spent several weeks chasing down leads to no avail. All we can tell is that when the websites go down (and come back up, and go down, and come back up…) the aborted_connects
MySQL variable starts increasing somewhat quickly. The only way we've been able to restore order has been to restart the server. After that, it can take as little as an hour or as long as a few days, but the problem always comes cropping up again. This began immediately after upgrading from 5.1 to 5.6.
I've looked through the log files, specifically for threads which have a Connect
logged, but no corresponding Quit
, and I've found something. The culprit appears to be the following two lines:
43375 Connect Access denied for user 'test'@'ch.websitepulse.net' (using password: NO)
43375 Connect test@ch.websitepulse.net as on
I assume that "websitepulse" is a service we use to monitor the database and make sure it's up, but the only guy who would know for sure isn't here today. We likely knowingly use (and maybe pay for) this service.
Throughout the log file, there are a good number of lines pretty much identical to the two above, and the thread has no corresponding quit message. It would seem that the first line, access being denied, would indicate that there wasn't even a successful connection established, so there would be no reason for a Quit
. The second line, however, has me wondering. It appears that despite access being denied, it still connects somehow. No queries are ever executed, and it's always just these same two lines.
The two spaces on the second line between "as" and "on" in the second line are no mistake. There is nothing there, or after "on", as I suspect there should be. Our database guy said that the number of aborted connections corresponded to the number of connections by user NULL@NULL
. The as <blank> on <blank>
would seem to indicate that this user is our NULL
.
Does this sound right to anyone? If so, how might we go about fixing it? I'm really in the dark, and Googling it hasn't turned up anything promising.
Thanks so much.
Best Answer
Sometimes, running
FLUSH HOSTS;
will clear up the host cache when you can no longer connect. Why ?According to the MySQL Documentation on
FLUSH HOSTS
When you restart mysql, it clears the host cache in a very heavy-handed manner. Therefore, to apply some preventative to this problem, you should be setting max_connect_errors to 1000000000000 (Yes, that's a trillion). Since max_connect_errors is dynamic, a mysql restart is not needed. Just run
then add the variable to my.cnf like this
Give it a Try !!!