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
Log on to the ApsaraDB for OceanBase console.
In the left-side navigation pane, click Clusters.
On the Clusters page, click the target cluster to go to the Cluster Workspace page.
Click the target tenant in the Tenants list to go to the Tenant Workspace page of the Oracle or MySQL tenant.
Obtain connection parameters.
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.Obtain the value for
-u
: View or create your account name on the Account Management page. For more information, see Create an account.Obtain the value for
-p
: Enter the password that you set when you created the account. For more information, see Create an account.