Host is blocked due to too many connection errors
Production Risk
High — all connections from the blocked host are refused.
MySQL has blocked a host because it has exceeded the max_connect_errors threshold. This is a security mechanism to prevent brute-force attacks. The host remains blocked until the error counter is flushed.
- 1Client host repeatedly failed to connect (wrong password, aborted connections, network errors).
- 2Number of consecutive connection errors exceeded max_connect_errors.
- 3Network issue causing TCP connections to be established but then dropped before authentication.
-- Occurs at connection time from a blocked host
expected output
ERROR 2013 (HY000): Host '192.168.1.10' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'.
Fix 1
Flush the host error count
FLUSH HOSTS; -- Or from the OS: mysqladmin flush-hosts -u root -p
Why this works
Resetting the error counter unblocks the host immediately.
Fix 2
Increase max_connect_errors to reduce false blocking
SET GLOBAL max_connect_errors = 100;
Why this works
A higher threshold reduces the chance of legitimate hosts being blocked.
Fix 3
Investigate why the host was generating connection errors
-- Review /var/log/mysql/error.log for the host's error history
Why this works
Fixing the root cause prevents re-blocking.
✕
MySQL 8.0 — 2013 ER_HOST_IS_BLOCKED
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev