All Products
Search
Document Center

ApsaraDB for OceanBase:Obtain connection parameters

Last Updated:Dec 05, 2023

When you connect to an OceanBase database deployed on cloud, each tenant has independent connection parameters, such as the access address and port. You can log on to the ApsaraDB for OceanBase console to obtain the connection parameters.

Background information

For example, you can connect to an OceanBase database from OBClient by running the following command:

$ obclient -hxxx.xxx.xxx.xxx -P3306 -ua**** -p****** -Dtest

The following table describes the connection parameters in the command.

Parameter

Description

-h

The domain name of the OceanBase database to be connected.

-P

The port for connecting to the OceanBase database. The default port is 3306 in MySQL mode, 1521 in Oracle mode, and 3307 in Key-Value mode.

-u

The tenant account.

-p

The account password. For security reasons, you do not need to specify this parameter. In that case, you will be prompted to enter a password later. The password is invisible.

-D

The name of the database.

Note

This parameter is valid only in MySQL mode.

Procedure

  1. Log on to the ApsaraDB for OceanBase console.

  2. In the left-side navigation pane, click Clusters.

  3. On the Clusters page, click the target cluster to go to the Cluster Workspace page.

  4. Click the target tenant in the Tenants list to go to the Tenant Workspace page of the Oracle or MySQL tenant.

  5. Obtain connection parameters.

    1. Obtain the values for -h and -P: In the Deployment Diagram section, you can view the connection information of the tenant. The connection information is a connection string that contains the IP address (or domain name) and port number.

      阿里云

    2. Obtain the value for -u: View or create your account name on the Account Management page. For more information, see Create an account.

    3. Obtain the value for -p: Enter the password that you set when you created the account. For more information, see Create an account.