【 使用环境 】生产环境
【 OB or 其他组件 】oceanbase
【 使用版本 】 4.2.1.8
【问题描述】
设置了connection_control_min_connection_delay=100000和connection_control_failed_connections_threshold=1,测试重复一次错误输入就会锁用户,但是10s内就自动解锁了,connection_control_min_connection_delay这个参数的单位是milliseconds,是1s=1000milliseconds么。
如果手动解锁用户,如果查询用户处于锁定状态。
2 个赞
--- 查询用户是否锁定
select host,user,account_locked from mysql.user;
--- 锁定账户
alter user username account lock;
--- 解锁账户
alter user username account unlock;
2 个赞
1、connection_control_failed_connections_threshold
–连续失败的最大次数,0表示不开启
2、connection_control_min_connection_delay
–超过最大失败次数之后阻塞登录最小时间(毫秒)
3、connection_control_max_connection_delay
–超过最大失败次数之后阻塞登录最大时间(毫秒)
待用户错误登录次数超过指定的值后,系统会对账户进行锁定,具体锁定时间通过以下公式来计算:
MIN(MAX((current_failed_login_num + 1 - connection_control_failed_connections_threshold) * 1000, connection_control_min_connection_delay), connection_control_max_connection_delay)
其中:
-
current_failed_login_num表示用户当前连续错误登录的次数,且current_failed_login_num大于或等于connection_control_failed_connections_threshold。 - 配置项
connection_control_min_connection_delay用于指定超过连续错误登录次数阈值之后锁定时长的最小值,取值范围为 [1000,2147483647],默认值为1000,单位为毫秒。关于配置项connection_control_min_connection_delay的更多信息,参见 connection_control_min_connection_delay。 - 配置项
connection_control_max_connection_delay用于指定超过连续错误登录次数阈值之后锁定时长的最大值,取值范围为 [1000,2147483647],默认值为2147483647,单位为毫秒。关于配置项connection_control_max_connection_delay的更多信息,参见 connection_control_max_connection_delay。




