This topic provides a step-by-step guide on connecting to an OceanBase Cloud database using Huawei Cloud VPC Endpoint.
Prerequisites
- You have registered a Huawei Cloud primary account.
- You have registered an OceanBase Cloud account, and have created an instance and a tenant. For more information, refer to Create an instance and Create a tenant. In this topic, a MySQL-compatible tenant is used.
Procedure
Log in to the OceanBase Cloud console, and click Networking in the left-side navigation pane.
On the Private Connectivity tab, click Create Private Connection.
In Step 1: Create your endpoint service, select Huawei Cloud as the cloud vendor, and select the target instance and tenant.
Under Step 1: Create your endpoint service, navigate to the Huawei Cloud console. Hover over your account in the top-right corner, select My Credentials from the dropdown menu, and copy your Account ID from the API Credentials page.
Return to the OceanBase Cloud Console, enter your account ID, and click Create Endpoint Service.
After creating the endpoint service, navigate to Step 2: Create an endpoint and copy the Service ID for later use.
In the Huawei Cloud VPC Endpoints page, click Buy VPC Endpoint and configure the following:
Configuration Item Description Region Select the same region as your OceanBase Cloud instance. Service Category Select Find a service by name. VPC Endpoint Service Name Enter the Service ID copied from Step 5 and click Verify. VPC Select your virtual private cloud. Click Next. In the endpoint list, click the newly created Endpoint ID to view its details. Copy the Endpoint ID and IPv4 address.
Return to the OceanBase Cloud console, navigate to Step 2: Create an endpoint, and paste the Endpoint ID and IP address. Click Next Step.
Under Step 3: Connect, select an existing database and account, or create new ones, and select MySQL CLI as the connection method. Copy the generated connection string to your client.
Currently, OceanBase Cloud supports a wide range of clients, drivers, and languages. For more information, refer to Overview.
In the CLI of your MySQL client, enter the account name and password generated in Step 9. Then, you can connect to and use OceanBase Cloud.
What's next
After creating the endpoint, you can view its details on the Topology Diagram tab on the Overview page of the tenant. If you need to update the endpoint due to VPC changes, OceanBase Cloud allows you to delete the existing endpoint and recreate it.
To delete an endpoint:
In the OceanBase Cloud console, navigate to the Instances page and click the target tenant name to enter the Overview page of the tenant.
In the Topology Diagram, click the delete button to remove the existing endpoint.