oceanbase错误输入多次导致用户锁住,如何解锁 User locked,connection_control_failed_connections_threshold=1多次正确登录也会导致锁用户

【 使用环境 】生产环境
【 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 个赞



将超时时间设置为1s(1000),输入1次以上错误密码后,过了超过1s,查询user表状态还是锁定。锁定后正确密码登录第一次能登录,第二次无法登录,需要手动解锁。

2 个赞

设置了connection_control_failed_connections_threshold=1之后
多次输入正确密码也会导致锁用户,除非将参数改为0

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