This page describes common database connection issues.
Symptoms
A connection to the database cannot be established.
Causes
The following issues can prevent a database connection:
The public endpoint and private endpoint are configured incorrectly.
The IP address or CIDR block of the client is not added to the whitelist.
The network type of the ECS client instance is not a virtual private cloud (VPC).
The ECS client and the OceanBase instance are in different regions.
The VPC of the ECS client is different from the VPC of the OceanBase tenant.
Solutions
Check the public and private endpoints
Log on to the OceanBase Management Console.
On the Cluster List page, select the desired cluster and click its name to open the Cluster Workspace.
In the navigation pane on the left, click Tenant Management to open the Tenant List page. Click the tenant name to open the Tenant Workspace.
In the Deployment Diagram section, view the private and public endpoints.
NoteA private endpoint is requested by default when a tenant is created. For a public network connection, you must click Request Public Endpoint.
Check the whitelist settings
Log on to the OceanBase Management Console.
On the Cluster List page, select the desired cluster and click its name to open the Cluster Workspace.
In the navigation pane on the left, click Security Settings.
In the Whitelist Group section of the Security Settings page, verify that the IP address or CIDR block of the client is in the whitelist.
NoteThe OceanBase whitelist applies at the cluster level. Therefore, it cannot distinguish between tenants or network connection types, such as internal or public.
The whitelist addresses for accessing OceanBase over a public or internal network are set as follows:
Internal network access: The address range in the whitelist must be the internal IP address of the ECS instance.
Public network access: Verify that the public IP address added to the whitelist is the actual egress IP address of the device. For example, if the IP address is 127.0.0.1, no device can access the tenant.
For more information, see Whitelist groups.
Check the username and password
Log on to the OceanBase console.
In the navigation pane on the left, click Cluster List.
In the cluster list, select the destination cluster and click its name to go to the Cluster Workspace.
In the tenant list, click the name of the destination tenant to go to the Tenant Details page.
In the navigation pane on the left, click Account Management.
In the Account Management list, find the account, click Modify Password in the Operations column, reset the password, and retry the connection.
NoteAvoid entering the username and password with leading or trailing spaces. Also, avoid pasting hidden characters along with the credentials.
Check the tenant connection mode
Log on to the OceanBase console.
In the navigation pane on the left, click Cluster List.
In the cluster list, click the name of the destination cluster to open the Cluster Workspace.
In the tenant list, click the name of the destination tenant to open the Oracle or MySQL Tenant Workspace.
On the tenant workspace page, click the Log on to Database button in the upper-right corner to log on to ODC.
On the ODC homepage, on the Personal Connections tab, click New Connection.
Select the region where the tenant resides (public cloud) and confirm that the connection mode (MySQL or Oracle) is correct.
MySQL tenant
Oracle tenant
NoteOBClient connection format:
obclient -h[tenant_domain_name] -u[tenant_username] -P3306 -p[tenant_password]
NoteOBClient connection format:
obclient -h[tenant_domain_name] -u[tenant_username] -P1521 -p[tenant_password]
Check the network type of the ECS client instance
Verify that the network type of the ECS client instance is VPC.
Check the regions of the ECS client and the OceanBase instance
Ensure that the ECS client and the OceanBase instance are in the same region.
Check the VPCs of the ECS client and the OceanBase tenant
For an internal network connection, the VPC of the client must be the same as the VPC of the tenant in the OceanBase cluster.
This scenario applies if you do not use special methods to connect networks across different VPCs. For standard internal network access, the client and tenant must be in the same VPC.
View the VPC of the OceanBase tenant.
Log on to the OceanBase console.
In the navigation pane on the left, click Cluster List.
In the cluster list, select the destination cluster and click its name to go to the Cluster Workspace.
In the tenant list, click the name of the destination tenant to go to the Oracle or MySQL Tenant Details page.
In the Basic Information section, view the User VPC of the OceanBase instance.
View the VPC of the ECS client.
Log on to the Elastic Compute Service (ECS) console.
In the navigation pane on the left, click Instances & Images
Instances.In the Network Information section of the Instance Details page, view the VPC in the VPC field.
Confirm that the User VPC and the Virtual Private Cloud for OceanBase are the same.