This topic will use OceanBase Database in MySQL-compatible mode as an example to introduce how to connect to OceanBase Database in vividime V11 for data display.
Prerequisites
- You have downloaded and installed vividime V11.
- You have installed OceanBase Database and created a MySQL-compatible tenant.
Step 1: Obtain the OceanBase Database connection string
Contact the deployment personnel or administrator of OceanBase Database to obtain the corresponding database connection string, for example:
obclient -h$host -P$port -u$user_name -p$password -D$database_name
Parameter description:
$host: the IP address for connecting to OceanBase Database. For connection through OceanBase Database Proxy (ODP), use the ODP IP address. For direct connection, use the IP address of an OBServer node.$port: the port for connecting to OceanBase Database. For connection through ODP, the default port is2883, which can be customized during ODP deployment. For direct connection, the default port is2881, which can be customized during OceanBase Database deployment.$database_name: the name of the database to be accessed.Notice
The user for connecting to the tenant must have the
CREATE,INSERT,DROP, andSELECTprivileges on the database. For more information about user privileges, see Privilege types in MySQL-compatible mode.$user_name: the tenant connection account. For connection through ODP, the common format isusername@tenant name#cluster nameorcluster name:tenant name:username. For direct connection, the format isusername@tenant name.$password: the account password.
For more information about the connection string, see Connect to an OceanBase tenant by using OBClient.
Step 2: Connect to OceanBase Cloud in vividime
Log in to vividime, choose Data Sources > + to create a data source, and then choose OCEANBASE.
Configure the following information based on the connection string obtained in Step 1:
Parameter Description Setting method Two methods are available: by URL or by server. You can choose either method. Tenant mode Select the tenant mode for connecting to the database. MySQL-compatible mode is used as an example. Driver version Select the driver for connecting to the database. URL The URL of the data source, which contains the database name and server information. Modify the URL based on the actual database information, referring to the URL example provided on the page. Authentication method Two methods are available: provide a username and password, or use no authentication. Username The username for connecting to the database. Password The password for connecting to the database. Specify database Specify the database (catalog) to be displayed under the data source. If you specify a database name, only the corresponding database is displayed. If you do not specify a database name, all databases are displayed. Click Test Connection. If the message "Data source connectivity is normal" appears at the top of the page, the OceanBase Database is connected.
Click Save to complete the data source creation.