This topic describes the prerequisites and procedure for connecting to an Oracle-compatible tenant of OceanBase Cloud by using OceanBase Client (OBClient).
Prerequisites
- You have downloaded and installed OBClient.
- You have obtained the connection string of the target Oracle-compatible tenant in an OceanBase Cloud instance. For more information, see Obtain the connection string.
Procedure
Open a command shell locally.
Run the following command to use OBClient to connect to the target Oracle-compatible tenant in the OceanBase Cloud instance based on the obtained connection string mentioned in the "Prerequisites" section.
obclient -h ********.oceanbase.cloud -P 3306 -u ***** -D ***** -pThe parameters are described as follows:
-h: the access address of OceanBase Cloud.-P: the access port of OceanBase Cloud.-u: The username of the database account.-D: the name of the database to be accessed.-p: the password of the account.Note
For security purposes, we recommend that you do not directly enter the password on the CLI, especially in an environment where the script or historical records are visible. You can skip this option and enter the password when being prompted to.
The return result is as follows:
Welcome to the OceanBase. Commands end with ; or \g. Your OceanBase connection id is 21 Server version: OceanBase 4.3.2.0 (r200000272024061717-93c0ed73ebbcac6edbf7b585860b75d825935358) (Built Jun 17 2024 18:06:04) 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 [TEST_USER001]>To exit the OBClient command line, enter
exitand press Enter, or press the keyboard shortcut Ctrl+D.