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. The example in this topic uses a MySQL-compatible tenant. For more information, see Create a cluster instance and Create a tenant.
Procedure
Log in to the OceanBase Cloud console. On the Instances page, expand the the target instance and click Connect > Get Connection String under the target tenant.
In the dialog box that appears, click Connect via Public Network.
Under Step 1: Get Public Endpoint, click Get Public Endpoint. After the public IP address is successfully 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 Link Encryption.
Under 3. Access Database, create a database and an account, and obtain the example connection string.
Create a database: Click + Create Database. In the dialog box that appears, specify a name for the database, such as
default_database. Then, click Create.Create an account: Click + Create Account. In the dialog box that appears, specify an account name and click Generate Password. Then, the system will automatically generate a password for your account. You can also define a password. The password must be 10 to 32 characters in length and contain at least two digits, two uppercase letters, two lowercase letters, and two special characters. Supported special characters are
@ # $ % _ +.Notice
Please keep the password generated during account creation 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.
