---
title: 指定 clusterid 的方式连接 ODP 登录失败-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于 指定 clusterid 的方式连接 ODP 登录失败相关的常见问题和使用技巧，帮助您快速解决 指定 clusterid 的方式连接 ODP 登录失败的难题。
---
切换语言

- 简体中文
- English

划线反馈

# 指定 clusterid 的方式连接 ODP 登录失败

更新时间：2023-11-13 02:05

适用版本： V1.x、V3.x、V4.x 内容类型：Troubleshoot  

## 适用版本

ODP 所有版本。

## 问题现象

登录时使用 `user@tenant#cluster:id` 的方式连接 ODP 报权限验证失败，而直接使用 `user@tenant` 则成功。

```shell
mysql -hxxx.xxx.xxx.xxx -P2883 -uroot@sys#obdemo:1111 -p'xxxxxx' -A oceanbase
ERROR 2013 (HY000) : Lost Connection to MySQL server at 'reading authorization  packet', system error: 0

```

```shell
mysql -hxxx.xxx.xxx.xxx -P2883 -uroot@sys#obdemo -p'xxxxxx' -A oceanbase
Welcome to the MariaDB monitor.  Commands end with ; or \g.

```

## 问题原因

ODP 选择的启动方式为 RSList，只能服务 RSList 指定的 OceanBase 集群，不具备多集群能力，因而也不支持在连接时指定 cluster_id。

## 解决方法

修改 ODP 的启动方式为 configURL，示例如下：

```
#使用 RSList 的启动命令:
./bin/obproxy -p 2883 -n demo_proxy -c obdemo -r "xxx.xxx.xxx:2881;xxx.xxx.xxx:2881;xxx.xxx.xxx:2881 -o "log_dir_size_threshold=10G,proxy_mem_limited=2G" -c obdemo

#使用 configURL 的启动命令:
./bin/obproxy -p 2883 -n demo_proxy  -o "obproxy_config_server_url=http://xxx.xxx.xxx.xxx:8080/services?User_ID=alibaba&UID=test&Action=GetObProxyConfig&ObproxyClusterName=demo_proxy,log_dir_size_threshold=10G,proxy_mem_limited=2G"

```

Previous

[ODP 集群启动时，遇到报错 Segmentation fault](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000210037)

Next

[如何为 ODP 配置负载均衡规则](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000210047) ![有帮助](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)[AI](https://www.oceanbase.com/obi) 咨询热线
