首批通过分布式安全可靠测评,为关键业务系统打造
租户创建后验证
更新时间:2023-07-25 13:45:37
业务租户创建完成后,您可以通过以下方式验证 OBProxy 服务与 OceanBase 数据库的连通性。
使用 MySQL 或 OBClient 客户端登录 OBProxy 代理服务的 ip:port,确保能联通 OceanBase 数据库并执行测试语句成功。
连接 OceanBase 数据库
$obclient -h10.10.10.1 -P2883 -uuser_name@tenant_name#cluster_name -p
Enter password:
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 37676
Server version: OceanBase 4.0.0.0 (r101000022022120716-0d7927892ad6d830e28437af099f018b0ad9a322) (Built Dec 7 2022 16:22:15)
Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient [(none)]>
说明
连接参数解释如下:
- -h:提供 OceanBase 数据库连接 IP,通常是一个 OBProxy 域名。
- -u:提供租户的连接账户,格式有两种:用户名@租户名#集群名 或者 集群名:租户名:用户名。MySQL 租户的管理员用户名默认是 root;Oracle 租户的管理员用户名默认是 SYS。
- -P:提供 OceanBase 数据库连接端口,也是 OBProxy 的监听端口。
- -p:提供账户密码,为了安全可以不提供,改为在后面提示符下输入,密码文本不可见。
- -c:表示在 MySQL 运行环境中不要忽略注释。
- -Ne:表示在 MySQL 连接数据库时执行 SQL 语句。
相关文档
有关连接数据库的详细信息,请参见 连接方式概述。