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

版权声明:原创文章,转载请注明出处。 https://blog.csdn.net/weixin_40559167/article/details/82885644

某台应用服务器连接数据库的时候报错:Host '192.168.210.79' is blocked because of many connection errors; unblock with 'mysqladmin flush-h

原因是网络原因导致该ip访问数据库被阻塞,多次失败,该ip被mysql屏蔽。(注意输错密码并不会导致这种情况)
查看最大错误连接数:
MariaDB [information_schema]> show variables like '%max_connect_errors%';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| max_connect_errors | 100   |
+--------------------+-------+

此时可以查看:
select * from performance_schema.host_cache;

解决方法:
进入数据库执行:flush hosts;
或者使用mysqladmin:mysqladmin flush-hosts -uroot -p -S /tmp/mysql3306.sock

猜你喜欢

转载自blog.csdn.net/weixin_40559167/article/details/82885644