本文为您介绍登录 OceanBase 迁移服务(OceanBase Migration Service,OMS)控制台时,admin 用户的密码被锁定的原因和解决方法。
适用版本
适用于 OMS 全部版本。
问题描述
登录 OMS 控制台时,出现 密码已锁定,当前用户角色:ADMIN,请联系更高权限用户协助修改密码 的报错。
问题原因
登录 OMS 控制台时,如果您连续 5 次输入错误密码,账号会被锁定并出现上述报错。
解决方法
root 用户未锁定
在 root 用户未锁定的情况下,OMS 的 admin 用户被锁定后,您可以使用 root 用户登录 OMS 控制台,修改或更新 admin 用户的密码,即可解锁。
如果您需要获取 root 用户的密码,请联系 OMS 技术支持人员。
root 用户被锁定
在 root 用户被锁定的情况下,请使用 OMS meta 租户连接 metadb 集群,oms_rm 库下有一张 oms_user 表,表中字段 is_locked 值为 0 代表正常,为 1 代表被锁定。login_failure_times 代表登录失败的次数,最大次数为 5。
admin 用户被锁定时,UPDATE 该表的 is_locked 字段为 0 以及 login_failure_times 字段值为 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,login_failure_times from oms_user;
+--------+-------+-------+--------------------------------+-----------+--------------------+
| id | name | role | comment | is_locked | login_failure_times|
+--------+-------+-------+--------------------------------+-----------+--------------------+
| u00000 | root | ROOT | NULL | 0 | 0 |
| u00001 | admin | ADMIN | NULL | 1 | 5 |
| u00002 | HA | ROOT | HA 组件使用,用户勿用 | 0 | 0 |
+--------+-------+-------+--------------------------------+-----------+--------------------+
3 rows in set (0.02 sec)
mysql> update oms_user set is_locked=0, login_failure_times=0 where name='admin';
mysql> select id,name,role,comment,is_locked,login_failure_times from oms_user;
+--------+-------+-------+--------------------------------+-----------+--------------------+
| id | name | role | comment | is_locked | login_failure_times|
+--------+-------+-------+--------------------------------+-----------+--------------------+
| u00000 | root | ROOT | NULL | 0 | 0 |
| u00001 | admin | ADMIN | NULL | 0 | 0 |
| u00002 | HA | ROOT | HA 组件使用,用户勿用 | 0 | 0 |
+--------+-------+-------+--------------------------------+-----------+--------------------+
3 rows in set (0.01 sec)