OceanBase Cloud supports connecting to databases using both public and private IP addresses. This topic describes how to connect to a database using a public IP address.
Prerequisites
You have registered an OceanBase Cloud account and created a cluster instance and a tenant. For more information, see Create a cluster instance.
Procedure
Log in to the OceanBase Cloud console. On the Instances page, expand the target instance and click Connect > Get Connection String under the target tenant.
In the dialog box that appears, select Connect via Public Network.
Under Step 1: Get Public Endpoint, click Get Public Endpoint. After the public IP address is obtained, click Next.
Note
Obtaining the endpoint takes about 1 minute. Please be patient. If you selected the Automatically Create Public Endpoint option when creating the tenant, the created public IP address will be automatically displayed here, and you can skip this step.
Under Step 2: Security Settings, click 1. Add IP address(es) to Allowlist and then click Add.
In the Add Allowlist dialog box, enter a custom group name and the IP addresses to be added to the allowlist, then click OK.
Add My Current IP Address: Your current IP address is automatically obtained and entered. Other IP addresses must be manually entered.
Allow All IP Addresses:
0.0.0.0is automatically entered. In this case, all IP addresses can be used to access the current tenant.
Under 2. Download the CA certificate to connect securely to the tenant, download the CA certificate and configure it. For more information, see SSL encryption.
Under 3. Access the database, create a database and an account.
Create a database: Click Create Database in the database drop-down menu, customize the database name in the dialog box, and click Create.
Create an account: Click Create Account in the account drop-down menu, and enter the account name and password. You can choose for the system to generate a password for you, or you can create your own. The password must be 10 to 32 characters long and contain at least 2 digits, 2 uppercase letters, 2 lowercase letters, and 2 special characters. Supported special characters are
@#$%_+. Then click Create.Notice
Please keep the password generated when creating the account secure.
Select MySQL CLI as the connection method, copy the generated connection string to your client, and then enter the account credentials created in Step 7 to connect. After a successful connection, you can access and use the database.
Note
OceanBase Cloud currently supports connections using various clients, drivers, and languages. This is just an example. You can choose different connection methods to generate connection strings based on your actual needs.
