MySQL Variables max_connect_errors 数据库 参数变量解释及正确配置使用
本站中文解释
MySQL的max_connect_errors参数变量用于控制MySQL 服务器允许用户最大的连接错误次数。该变量的默认值为10。当MySQL服务器发现一个用户连接失败次数超过该变量所设置值以后,MySQL服务器就会把该用户连接上所有的权限都取消掉,直到下次重启MySQL服务器之后才能恢复。因此,在一个繁忙的MySQL服务器系统中,max_connect_errors的值应该要低些,防止失误操作而禁止了一个正常用户的登录连接。
max_connect_errors变量可以通过在MySQL系统 shell中,输入相应的SQL语句进行设置,语句如下:
set global max_connect_errors= n;
其中,n为一个正整数,代表最大可以允许的连接失败次数。
官方英文解释
max_connect_errors
Command-Line Format | --max-connect-errors=# |
---|---|
System Variable | max_connect_errors |
Scope | Global |
Dynamic | Yes |
Type | Integer |
Default Value | 100 |
Minimum Value | 1 |
Maximum Value (64-bit platforms) | 18446744073709551615 |
Maximum Value (32-bit platforms) | 4294967295 |
After max_connect_errors
successive connection requests from a host are interrupted
without a successful connection, the server blocks that host
from further connections. If a connection from a host is
established successfully within fewer than
max_connect_errors
attempts
after a previous connection was interrupted, the error count
for the host is cleared to zero. To unblock blocked hosts,
flush the host cache; see
Flushing the Host Cache.