A
A
Adel1ne2016-06-14 05:31:44
PHP
Adel1ne, 2016-06-14 05:31:44

SQLSTATE[HY000] [1129] Host 'XX.XX.XX.XX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts?

Hello!
Raised the site on OpenServer'e in LAN, as if everything suits, but such an error periodically appears. Only restarting OpenServer helps.
The site is based on the Yii2 engine, on the server where the site is located BlockHost is installed.
All queries to the database through the appropriate table models:
for example ModelName::findOne(['id' => $id]);
, though there are some queries like this:
ModelName::findBySql('SELECT * FROM table')->all();
The exec('ping '.$compName, $cmd); function is also implemented in the code.
That's all that makes me suspicious.
Tell me how you can analyze the cause of an error in MySQL?
On the Internet, it is advised to first check TCP / IP, again, how can this be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly, 2016-06-14
@vshvydky

googled it for you: MySQL documentation
Why is this possible? I can assume that you open a bunch of connections in a loop and pull out some data through them, for example
for(id = 1, id < 10000000, id++)
connect to the database to select this id.
In order to check my assumption, you can look at the SQL console:
A handy tool for working with MySQL dbForge Studio
Separately, I note that SHOW FULL PROCESSLIST shows the result for now and to use it as online monitoring, you can use the above program, there is a query update frequency setting , set it to 1 second and wait until your site starts flooding the server, then you look at what code it crap there, look for it in your code, rewrite it.
And yes, at the expense of restarting the server:

unblock with 'mysqladmin flush-hosts

S
sim3x, 2016-06-14
@sim3x

your code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question