The desktop ODC supports connecting to tenants in MySQL-compatible mode of OceanBase Cloud. This topic describes the prerequisites and procedure for this connection method.
Prerequisites
You have installed the OceanBase Developer Center (ODC) desktop version. For instructions, see Install desktop ODC.
You have obtained the connection string of the target tenant in MySQL mode from the OceanBase Cloud instance. For instructions, see Get a connection string.
Procedure
Open the desktop ODC. Next to the search box at the top left of the Data Sources interface, click + > OB Cloud MySQL.
In the Create Data Source panel, enter or select the following information based on the connection string obtained in the Prerequisites section.
Information ItemDescriptionSmart Parsing (Optional) You can paste the connection string into the intelligent parsing text box. ODC automatically identifies the string and populates the connection information fields. Connection Address - Host IP/Domain Name: The IP address or domain name of the server where the database to be connected is located.
- Port: The port number of the server where the database to be connected is located.
Database Account - Database Username: An account created in the tenant (in MySQL-compatible mode, this account must have permission to access the default database).
- Database Password: The password for the account created in the tenant. Click Test Connection to test whether you can connect to the target database.
Note
- If the configuration information is incorrect, an error message will appear, for example, due to an invalid username or password, or a network issue.
- You can only connect to databases within the current tenant. Otherwise, a test failure error will be reported.
- Before saving, you can click Test Connection to test the database connection. If the database username and password are correct, Connection Successful is displayed. In ODC V4.0.0 and later, you can save the connection without entering the account and password.
Environment Select the environment type as needed: Development/Test/Production, etc. Advanced Settings - sys Tenant Account: Choose whether to Query Tenant Views Using sys Tenant Account. If selected, enter the Account and Password.
For a physical database, enter an account with permission to query sys tenant views and its password. This field is automatically populated when Tenant in Connection Address is specified as sys.- Account: An account with permission to query views in the sys tenant.
- Password: The password for the account.
- SSL: Choose whether to enable SSL encryption for the SSL link to ensure secure data transmission between the client and server.
Before enabling SSL in ODC, confirm that SSL is enabled on the OBServer side; if connecting via OBProxy, also ensure SSL is enabled for OBProxy. To enable SSL on the server side, see OBServer Transmission Encryption. - Connection Initialization Script: Supports configuring the connection session through SQL statements. Example:
set session ob_query_timeout=60000000 - Driver Properties: Supports configuring driver properties to connect to OceanBase Database and implement specific features.
Note
- In ODC V2.3.0 and later, the import/export feature requires setting the root@sys user in the advanced configuration during connection creation.
- In ODC V2.4.1 and later, the import/export feature's dependency on the root@sys account for querying view information is removed (if the root@sys account is not configured, some ODC objects such as stored procedures and functions do not support the export feature; if the root@sys account is configured, accessing view information in the sys tenant provides the optimal data routing strategy, which can improve export speed).
- sys Tenant Account and Password are the account and password of a user under the cluster tenant (do not fill in "@sys#cluster" for the account). For example: the account is root.
- Users created by the non-encrypted method (require none) (default is require none) can choose whether to enable SSL as needed. If you select Enable SSL, an SSL connection will be created; if not selected, a regular connection is created.
- For users created by the SSL connection method (require ssl), selecting Enable SSL creates an SSL connection; if not selected, the connection fails.
Users created by require ssl do not need to upload a certificate but must select Enable SSL; otherwise, the connection fails. It is recommended to upload a certificate to verify the identities of both communicating parties (not mandatory):- Upload a CA certificate, and the client verifies the server's identity;
- Upload the client key and client certificate, and the server verifies the client's identity.
- Users created by the x509 encryption method (require x509) must Enable SSL and upload the CA certificate as well as the client key and client certificate. Both the client and server verify each other's identities; not selecting Enable SSL or not uploading the certificate prevents successful connection creation.
Click the OK button in the lower-right corner of the panel, and enter a custom data source name in the dialog box to complete the data source creation.