首批通过分布式安全可靠测评,为关键业务系统打造
如何处理用户密码被锁定的问题
更新时间:2026-04-14 15:40:38
本文为您介绍登录 OceanBase 迁移服务(OceanBase Migration Service,OMS)社区版控制台时,用户的密码被锁定的原因和解决方法。
适用版本
适用于 OMS 社区版全部版本。
问题描述
登录 OMS 社区版控制台时,出现密码被锁定或密码已过期的情况。
问题原因
登录 OMS 社区版控制台时,如果您连续 6 次输入错误密码,账号会被锁定并出现报错。
用户密码已过期。
解决方法
密码被锁定的解决方法
方法一:
OMS 社区版的 admin 用户被锁定后,您可以使用 root 用户登录 OMS 社区版控制台,修改或更新 admin 用户的密码,即可解锁。
如果您需要获取 root 用户的密码,请联系 OMS 社区版技术支持人员。
方法二:
使用 OMS meta 租户连接 metadb 集群,
oms_rm库下有一张oms_user表,表中字段is_locked值为 0 代表正常,为 1 代表被锁定。被锁定时update该表的is_locked字段为 0 即可。# mysql -hxxx.xxx.xxx.xxx -uroot@OMS_META -P2881 -pxxx oms_rm mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3221720053 Server version: 5.7.25 OceanBase 2.2.77 (r116010032023022813-xxxxd8c1500c21c) (Built Feb 28 2023 13:48:43) Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select id,name,role,comment,is_locked from oms_user; +--------+-------+-------+--------------------------------+-----------+ | id | name | role | comment | is_locked | +--------+-------+-------+--------------------------------+-----------+ | u00000 | root | ROOT | NULL | 0 | | u00001 | admin | ADMIN | NULL | 1 | | u00002 | HA | ROOT | HA 组件使用,用户勿用 | 0 | +--------+-------+-------+--------------------------------+-----------+ 3 rows in set (0.02 sec) mysql> update oms_user set is_locked=0 where name='admin'; mysql> select id,name,role,comment,is_locked from oms_user; +--------+-------+-------+--------------------------------+-----------+ | id | name | role | comment | is_locked | +--------+-------+-------+--------------------------------+-----------+ | u00000 | root | ROOT | NULL | 0 | | u00001 | admin | ADMIN | NULL | 0 | | u00002 | HA | ROOT | HA 组件使用,用户勿用 | 0 | +--------+-------+-------+--------------------------------+-----------+ 3 rows in set (0.01 sec)
密码已过期的解决方法
使用 OMS 社区版 meta 租户连接 metadb 集群,进入
oms_rm库。mysql -hxxx.xxx.xxx.xxx -uroot@OMS_META -P2881 -pxxx oms_rm更新
oms_normal_config参数的值。update oms_normal_config set cfg_value='{"rootRolePasswordValidityDays":3650,"rootViewerRolePasswordValidityDays":3650,"adminRolePasswordValidityDays":3650,"adminViewerRolePasswordValidityDays":3650,"userRolePasswordValidityDays":90,"userPasswordValidityDaysTipsThreshold":30}' where cfg_name='oms.user.password.expiration.date.config';