OceanBase Developer Center (ODC) allows you to connect to a user tenant of OceanBase AI Database. This topic describes how to connect to OceanBase AI Database by using ODC.
Prerequisites
You have deployed ODC and obtained the URL of Web ODC. For more information about how to deploy ODC, see Deploy ODC.
Procedure
This topic provides an example of creating a personal connection in Web ODC. The procedure is as follows:
On the login page of ODC, enter your registered account, the password, and the verification code, and then click Log In.
On the Personal Connections tab of the homepage, click Create Connection in the upper-right corner to create a personal connection.
Note
When you run ODC for the first time, the loading time may take a bit longer than usual.
Specify the following parameters on the Create Connection tab. If you have an OceanBase AI Database connection string, which is in the format of
mysql -h <host name> -P <port number> -u <database username@tenant name> # <cluster name> -D <default database> -p '<database password>', you can obtain the information from the string. You can also paste the string in the field of Intelligent Parsing in the dialog box to automatically populate these parameters.Information ItemDescriptionDatabase Type Select Physical Database or Logical Database. - Physical Database: A regular database.
- Logical Database: ODP (Sharding).
Region Select Stand-Alone Deployment/Exclusive Cloud as the region where the connection example is located. Connection Name Specify the name of the connection. Set Tag Tags can be used to add explanatory information for connections.
Click the Set Tag button next to the Connection Name text box to assign a tag to the current connection. In the drop-down list that appears, you can perform operations to set and manage tags:- Set Tag: Select a target tag from the drop-down list to complete the setting. If the list is empty, create a new tag first.
- Manage Tags: Click the Create Tag button at the bottom of the list or click the settings icon above the list to pop up the Tag Management window. In the Tag Management window, you can edit and delete created tags. You can also click the Create Tag button above to specify the name and icon color for a new tag.
Intelligent Parsing Paste the connection string into the text box. ODC automatically recognizes it and fills in the connection information fields. Connection Mode Select MySQL (Logical databases support only MySQL mode). Connection Address - Host IP: The IP address of the server where the target database is located.
- Port: The port number of the server where the target database is located.
- Cluster Name: The name of the cluster where the target database is located (not required for logical databases).
- Tenant Name: The name of the tenant where the target database is located (not required for logical databases).
Note
The host name and port number can be obtained from the tenant information page of the target database, such as a tenant created on a public cloud or in OCP.
Database Account - Database Username: An account created in the tenant (this account must have permission to access the default database).
- Database Password: The password for the account created in the tenant. Click the Test Connection button next to the password field to test whether you can connect to the target database.
- Save Password: If you disable this option, the database password will not be saved in the connection information. Each time you connect or test the connection, you will need to enter the database password in the prompted dialog box. If you enable this option, the database password will be saved, and you will not need to enter it each time you connect.
Note
- If the configuration information is incorrect, an error message will appear, for example, due to incorrect username/password or network issues.
- You can only connect to databases within the current tenant; otherwise, a test failure error will be reported.
- ODC V4.0.0 and later versions support saving connections without providing account credentials.
Default Database/schema (Optional) When connecting to a database in a user tenant, you need to specify the default database for this connection. Note
If no default database is specified, the information_schema database is connected by default. If the information_schema database connection fails, set the default database to a database with which the user has permission.
SQL Query Timeout Supports custom SQL query timeout. Queries automatically terminate when they exceed the specified time (default is 60 seconds). sys Tenant Account Settings Choose whether to use a sys tenant account to query tenant views. If selected, enter the Account and Password.
When the database type is a physical database, enter the account and password with permission to querysystenant views. This field is automatically populated if Tenant in the Connection Address field is already set to sys.- Account: An account with permission to query views in the sys tenant.
- Password: The password corresponding to the account.
Note
- Starting from ODC V2.3.0, the import/export feature requires setting the root@sys user in the advanced configuration during connection creation.
- Starting from ODC V2.4.1, the import/export feature's view information query no longer strongly depends on the root@sys account (if the root@sys account is not configured, some ODC objects like stored procedures and functions do not support the export feature; if the root@sys account is configured, accessing view information under the
systenant provides the optimal data routing strategy, which can improve export speed). - sys Tenant Account and Password should be the account and password of a user under the cluster tenant (do not enter "@sys#cluster" for the account). For example: the account is root.
Click Save to save the current configuration in the ODC connection list. When you log in to ODC the next time, you can directly select the connection from the list. The connection configuration does not necessarily need to pass the connection test when you save the configuration.
Note
Before you save the configuration, you can click Test Connection to test the database connection. If the database username and password are correct, the system returns a message indicating that the connection succeeded.
References
For more information about other features of ODC, see the ODC documentation of the corresponding version.