OceanBase Deployer Center (ODC) allows you to connect to a MySQL tenant in OceanBase Database. This topic describes how to connect to OceanBase Database by using ODC.
Prerequisites
ODC is deployed and you have obtained the URL of the web ODC. For more information about how to deploy ODC, see Deployment Guide of ODC.
Procedure
This topic takes the example of creating a private connection for a user tenant (mysql@tenant) in web ODC. Follow these steps:
On the logon page of ODC, enter your registered account, the password, and the verification code, and then click Log On.
On the Private Connections tab of the ODC homepage, click Create Connection in the upper-right corner to create a private 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 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 or you can use the Intelligent DNS Resolution tool on the tab to automatically specify these parameters.Parameter Description Database Type Select Physical Database or Logical Database. - Physical Database: regular databases.
- Logical Database: ODP (Sharding).
Region Select the region of the connection example. The options are BareMetal and Private Cloud. Connection Name Specify the name of the connection. Set Tag You can add some descriptive information for the connection.
Click the Set Tag button after Connection Name to set a tag for the current connection. You can set and manage tags in the drop-down list that appears.- Tag setting: Select a tag from the drop-down list. Create tags first if the list is empty.
- Tag management: Click Create Tag at the bottom of the list or the settings icon above the list to go to the Tags page, where you can edit or delete created tags. You can also click Create Tag to set a name or color for the new tag.
Intelligent Parsing You can paste a connection string to the field. ODC automatically identifies the string and fills in the corresponding fields on the page. Connection Mode Select MySQL. Logical databases support only the MySQL mode. Endpoint - Host IP: the IP address of the server where the connected database is located.
- Port: the port number of the server where the connected database is located.
- Cluster Name: the name of the cluster where the connected database is located. This parameter is not required for logical databases.
- Tenant Name: the name of the tenant in which the connected database is located. This parameter is not required for logical databases.
Note
You can obtain the host name and port number from the details page of the tenant in which the connected database is located, such as a tenant created on Alibaba Cloud or in OceanBase Cloud Platform (OCP).Database Account - Database Username: an account under the tenant. In MySQL mode, this account must have access to the default database.
- Database Password: the password of the account under the tenant. You can click Test Connection after the password box to test whether you can connect to the target database.
- Save Database Password: If you do not select this option, the database password will not be saved in the connection information. You need to enter the database password in the pop-up password window each time when you access the connection or test the connection. If you select this option, the database password will be saved in the connection information. You do not need to enter the database password when you access the connection again.
Note
- An error will be returned if the configurations such as the username, password, and network settings are invalid.
- You can only connect to a database in the current tenant. Otherwise, a test failure error will be returned.
- In ODC V4.0.0 and later, you can save the connection without entering the account and password.
Default Database/Schema (optional) When you connect to a MySQL tenant of OceanBase Database, you must specify the default database for the connection. Note
If you leave this parameter unspecified in MySQL mode, the information_schema database is connected by default. However, if the connection to the information_schema database fails, you need to specify a database on which the current user has access privileges.SQL Query Timeout Value You can specify a timeout value for SQL queries. A query whose execution time exceeds the timeout value is automatically terminated. The default timeout value is 60 seconds. Sys Tenant Account Settings Specify whether to use the sys tenant account to query tenant views. If you select this option, specify Account and Password.
When Database Type is set to Physical Database, you can specify an account that has the privilege to query views of the sys tenant, as well as its password. This field is automatically populated when sys is specified as the tenant in Endpoint.- Account: an account having the privilege to check the views of the sys tenant.
- Password: the password of the account.
Note
- In ODC V2.3.0 and later versions, to use the import and export features, you need to configure the
root@sysaccount in the Advanced Configuration section during connection creation. - Since ODC V2.4.1, the strong dependency on the
root@sysaccount is canceled when you use the import/export feature to query view information. If theroot@sysaccount is not configured, some objects in ODC such as stored procedures and functions cannot be exported. If theroot@sysaccount is configured, you can query views of thesystenant to obtain the optimal data routing strategy, thereby increasing the export speed. - The account and password of the sys tenant are the account and password of a user in a tenant of the cluster. Do not enter
@sys#clusterin the Account field. For example, the account isroot.
Click Save to save the current configuration in the ODC connection list. Next time you log on to ODC, 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.
More information
For more information about other features of ODC, see the ODC documentation in the OceanBase Database documentation center.