欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

解決ERROR?1129?(HY000):?Host?‘xxx‘?is?blocked?because?of?many問題

 更新時間:2024年04月01日 09:11:40   作者:亦是花  
這篇文章主要介紹了解決ERROR?1129?(HY000):?Host?‘xxx‘?is?blocked?because?of?many問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教

ERROR 1129 (HY000): Host ‘xxx‘ is blocked because of many

報錯

ERROR 1129 (HY000): Host '27.227.134.197' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

解決

mysql> flush hosts;

如果以上報如下錯,則使用下面步驟:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-hosts' at line 1
mysql> show variables like "max_connection_errors";

1.首先使用 root 登錄 mysql -u root -p 或者

mysql -uroot -h39.97.49.66 -p

2.提高允許的max_connection_errors數(shù)量:

① 進入Mysql數(shù)據(jù)庫查看

max_connection_errors: show variables like "max_connection_errors";

② 修改max_connection_errors的數(shù)量為1000:

set global max_connect_errors = 1000;

③ 修改 max_connections 的數(shù)量為1000 :

set global max_connections = 1000;

3.最后使用 mysql> flush-hosts; 命令清理一下hosts文件;

數(shù)據(jù)庫報錯create connection SQLException,......errorCode 1129, state HY000

報錯:

com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: jdbc:mysql://mysql:3306/config?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai, errorCode 1129, state HY000

錯誤:

Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

原因

同一個ip在短時間內(nèi)產(chǎn)生太多(超過mysql數(shù)據(jù)庫max_connection_errors的最大值)中斷的數(shù)據(jù)庫連接而導(dǎo)致的阻塞;

解決辦法

1、提高允許的max_connection_errors數(shù)量(我使用此方法):

① 進入Mysql數(shù)據(jù)庫查看max_connection_errors: show variables like '%max_connect_errors%';

② 修改max_connection_errors的數(shù)量為1000: set global max_connect_errors=1000;

③ 查看是否修改成功:show variables like '%max_connection_errors%';

永久性修改:vim  my.cnf

修改完配置文件,重啟mysql

最后再次查看服務(wù),發(fā)現(xiàn)報錯沒有了,恢復(fù)正常。

持續(xù)了一段時間又報出了這種錯誤,排查這臺服務(wù)器上的服務(wù),最后發(fā)現(xiàn)是因為有一個服務(wù)沒有創(chuàng)建數(shù)據(jù)庫用戶,所以導(dǎo)致這個服務(wù)一直連接數(shù)據(jù)庫報錯導(dǎo)致的。

總結(jié)

以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論