---
title: 如何修改 ODP Sharding 的 admin 用户的密码-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于如何修改 ODP Sharding 的 admin 用户的密码相关的常见问题和使用技巧，帮助您快速解决如何修改 ODP Sharding 的 admin 用户的密码的难题。
image: https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*OSPzQ6GUQF4AAAAAQHAAAAgAeiGDAQ/original
---
[OceanBase AI 数据大会](https://www.oceanbase.com/conference2026 "OceanBase AI 数据大会")

## 体验新一代 AI 数据平台

[立即咨询](https://www.oceanbase.com/contactus) [免费试用 免费试用](https://www.oceanbase.com/free-trial)划线反馈

# 如何修改 ODP Sharding 的 admin 用户的密码

更新时间：2026-07-24 10:01

适用版本： V3.x 内容类型：How-to  

ODP Sharding 控制台无法直接修改 admin 用户的密码，本文总结如何通过修改 meta 库修改 admin 用户密码。

## 适用版本

ODP Sharding 所有版本

## 操作步骤

通过控制台修改密码时会提示错误 `user 0000011 role is an administrator, please use the administrator role to modify the administrator identity information in the global configuration function`。

![obsharding](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/database/odp/d0fbef31-2658-4bb7-a491-4f130b045c7a.png)

可以通过以下步骤修改 admin 用户：

1. 通过 ODP meta 租户连接到 metadb 集群。
 2. 开启鉴权。

   ```shell
   obclient [(none)]> use dbpconsole_db;
   Database changed

   ```

   ```shell
   obclient [dbpconsole_db]> update zdalproxy_config set config_value='true' where config_key='global_auth_check';
   Query OK, 0 rows affected (0.01 sec)
   Rows matched: 1  Changed: 0  Warnings: 0

   ```

   ```shell
   obclient [dbpconsole_db]> select * from dbpconsole_db.zdalproxy_config where `config_key`='global_auth_check';
   +-----+---------------------+---------------------+------------+----------+-------------------+--------------+------------------------------------------------------+
   | id  | gmt_create          | gmt_modified        | env_tenant | env_mode | config_key        | config_value | description                                          |
   +-----+---------------------+---------------------+------------+----------+-------------------+--------------+------------------------------------------------------+
   | 242 | 2023-09-13 15:55:50 | 2023-09-13 15:55:50 | -          | -        | global_auth_check | true         | 是否需要权限校验，不加配置相当于true                 |
   +-----+---------------------+---------------------+------------+----------+-------------------+--------------+------------------------------------------------------+

   ```
 3. 插入密码配置项。

   ```shell
   obclient [dbpconsole_db]> INSERT INTO `zdalproxy_config`(`gmt_create`, `gmt_modified`, `env_tenant`, `env_mode`, `config_key`, `config_value`, `description`)  VALUES (now(), now(), '-', '-', 'global_embedded_user_info_key', '[{"userId":"0000011","username":"admin","password":"xxxxxx"}]', '修改密码');
   Query OK, 1 row affected (0.01 sec)

   ```

   ```shell
   obclient [dbpconsole_db]> select * from zdalproxy_config order by id desc limit 1;
   +---------+---------------------+---------------------+------------+----------+-------------------------------+--------------------------------------------------------------------+--------------+
   | id      | gmt_create          | gmt_modified        | env_tenant | env_mode | config_key                    | config_value                                                       | description  |
   +---------+---------------------+---------------------+------------+----------+-------------------------------+--------------------------------------------------------------------+--------------+
   | 2000317 | 2023-09-19 10:50:06 | 2023-09-19 10:50:06 | -          | -        | global_embedded_user_info_key | [{"userId":"0000011","username":"admin","password":"xxxxxx"}] | 修改密码     |
   +---------+---------------------+---------------------+------------+----------+-------------------------------+--------------------------------------------------------------------+--------------+
   1 row in set (0.01 sec)

   ```
 4. 修改密码或增加用户与步骤 3 类似。

   ```shell
   obclient [dbpconsole_db]> update zdalproxy_config set config_value='[{"userId":"000001","username":"admin","password":"xxxxxx"},{"userId":"000002","username":"test","password":"xxxxxx"}]'
   where config_key='global_embedded_user_info_key';
   Query OK, 1 row affected (0.02 sec)
   Rows matched: 1  Changed: 1  Warnings: 0

   ```

Previous

[升级 ODP OBSharding 过程中修改 ODP Server 端口引发的问题](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000210050)

Next

[Scan all 引起 ODP Server 经常性无法连接](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000210054) ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ) 咨询
