tencent cloud

Accessing Tencent Cloud CVM Self-Built Database
Last updated: 2025-07-23 17:37:37
Accessing Tencent Cloud CVM Self-Built Database
Last updated: 2025-07-23 17:37:37
This document introduces how to access Tencent Cloud CVM self-built database to TencentDB for DBbrain. By accessing self-built databases, you can enable autonomous services such as Monitoring and Alarm, Performance Optimization, and Database Management provided by DBbrain.
The Tencent Cloud CVM self-built database type that DBbrain currently supports: MySQL.

Connection Method

Agent-Based Access (recommended): Deploy the DBbrain gent on the database host to automatically detect your database. This supports all autonomous services provided by DBbrain. Strengths include:
Data transmission is encrypted.
The Agent automatically collects and temporarily stores data, ensuring no data loss even if the connection to the server is lost.
Communication between the server side and the Agent requires authentication, and SQL statements sent to the Agent include verification.
It is capable of collecting host resource information and slow logs, supporting slow log analysis.
Direct Access: No need to deploy the DBbrain Agent. Simply enter the database account and password under the condition of network connectivity to quickly access your database. This method supports some of the autonomous services provided by DBbrain and is suitable for accessing fewer self-built databases.
Note:
For a feature comparison of the two access methods, see the Feature Comparison.

Usage Restrictions​

CVM self-built database instances on the basic network (Classic) do not support connection to DBbrain.

​Prerequisites​

Please ensure the security group associated with the self-managed database's CVM has opened TCP port 8899 for Agent communication.​​

Agent-Based Access Process

Entering the Access Page

1. Log in to the DBbrain Console.
2. In the left sidebar, select Instance Overview.
3. At the top of the page, in the Self-Built Instance card, click Quick Access to enter the Self-Built Database Instance Access page.

4. In the CVM-Based Self-Built Database module, click Agent-Based Access to enter the access process.


Accessing CVM Self-Built Database

Step 1: Selecting CVM

On the Server Instance Selection page, select the CVM with a self-built database, then click Next to proceed to the Agent deployment.
Select how to specify servers: Supports list pull and manual input methods to acquire CVM.
When Select from List, users can directly obtain the instance list of the CVM under the account.
When selecting Enter, users can acquire the CVM by entering the instance IP address.
Select Region to Deploy DBbrain Service: Currently supports Guangzhou, Beijing, Shanghai, and Chengdu. If the region where the user's database is located is not within these regions, it is recommended to select the nearest one.
Select Servers:
If the acquisition method is Select from List, after selecting the region, users can directly select one or more CVMs from the list.

If the acquisition method is Enter, users can add CVMs by entering one or more instance IP addresses in the text box.


Step 2: Deploying Agent

On the Agent Deployment page, the previously selected CVMs and their Agent statuses are displayed.
1. On the Agent Deployment page, select a CVM, click Deploy in the Operation column, or select multiple CVMs, click Batch Deploy at the top left of the list to deploy the Agent on the CVM.
Note:
If the Agent is not deployed on CVM, the Agent status will be displayed as --.

2. In the pop-up dialog box, select the Agent port, click Deploy, and the Agent deployment command will be generated according to the selected port number.

3. Copy the generated Agent deployment command and run it on the CVM. If Start agent successfully appears, it means the Agent has been successfully deployed. Return to the Deployment page to see the Agent status changed to Connect normal.
The Agent status and corresponding operation instructions:
Agent Status
Status Description
Operation
Operating Instructions:
--
The Agent is not deployed on CVM.
Deploy
Click Deploy to deploy the Agent on the CVM.
In Deployment
Agent deployment is in progress.
View
Click View to see the port number and Agent command of the deploying Agent.
Reset
Click Reset to recover the Agent status to --, supporting scenarios where users want to change the Agent port number and redeploy the Agent.
Connect normal
The Agent has been successfully deployed on the CVM and is under normal monitoring and collection. The self-built database in this CVM can use the autonomous services provided by DBbrain normally.
View
Click View to see the port number and Agent command of the deployed Agent.
Stop
Click Stop to pause the connection of the Agent in normal connection status.
Reset
Click Reset to recover the Agent status to --, supporting scenarios where users want to change the Agent port number and redeploy the Agent.
Failed to connect.
Agent deployment failed on the CVM. See Agent Access Issues.
View
Click View to see the port number and Agent command of the Agent.
Reset
Click Reset to recover the Agent status to --, allowing you to change the Agent port number and redeploy the Agent.
Paused connection
The Agent has been successfully deployed on the CVM but is currently in a paused status for monitoring data collection.
View
Click View to see the port number and Agent command of the Agent.
Reconnecting
Click Reconnect to start the paused Agent and recover it to the Connect normal status.
Reset
Click Reset to recover the Agent status to --, supporting scenarios where users want to change the Agent port number and redeploy the Agent.

4. After at least one Agent is in Connect normal status, click Next to proceed to the next step and add a database.

Step 3: Adding Database

On the Add Database Instance page, it shows the CVM with the Agent successfully deployed and its database status from the previous step.
1. On the Add Database Instance page, select Database Type.
2. Select a CVM, click Add in the Operation column, or select multiple CVMs, click Batch Add Database at the top left of the list to add databases to the CVMs with the Agent successfully deployed.
Note:
For CVMs with the Agent successfully deployed, if no database is added, the database status is displayed as --.
3. In the pop-up dialog box, fill in the database port number, account, password, and database configuration, and click OK to complete the database addition.
Note:
If there is a database account authorization exception, see Database Account Authorization Exception.
The database account configuration is as follows:
Parameter Name
Parameter Description
Port
The database port number detected by the DBbrain Agent (If there are multiple databases in the CVM, you can click Add Port to manually add the database port number to access multiple CVM self-built databases simultaneously.).
Account
The account of the CVM self-built database (If the account has not been created, you need to click Generate Authorization Command first, then copy and execute the generated authorization command on the database.).
Password
The corresponding password for the CVM self-built database.
Database Configuration
Includes CPU, memory, and disk resources allocated by the host to the CVM self-built database. DBbrain calculates performance metrics based on the provided configuration details.
The database account authorization is as follows:
Permission
Description
PROCESS
View all connection processes. It is used for displaying real-time session processes.
REPLICATION SLAVE, REPLICATION CLIENT
View the status of the primary/secondary databases, and view relaylog and binlog events of the secondary database. It is used for diagnosing primary-secondary replication exceptions.
SHOW DATABASES, SHOW VIEW, RELOAD, SELECT
Default read permissions for databases and tables, as well as refresh permissions.

4. Return to the Add Database Instance page, and click Done. Databases with a connect normal status can successfully access DBbrain's autonomous services.
5. In the left sidebar, select Instance Management, and at the top, select the corresponding self-built database type to view and manage the accessed self-built database.

Direct Access Process

Entering the Access Page

1. Log in to the DBbrain Console.
2. In the left sidebar, select Instance Overview.
3. At the top of the page, in the Self-Built Instance card, click Quick Access to enter the Self-Built Database Instance Access page.

4. In the CVM-Based Self-Built Database module, click Direct Access to enter the access process.


Accessing CVM Self-Built Database

Step 1: Selecting CVM

On the Select Server Instance page, select the CVM with a self-built database, then click Next to proceed to the next step of adding the database.
Select how to specify servers: Supports list pull and manual input methods to acquire CVM:
When selecting Select from List, users can directly obtain the instance list of the CVM under the account.
When selecting Enter, users can acquire the CVM by entering the instance IP address.
Select Region to Deploy DBbrain Service: Currently supports Guangzhou, Beijing, Shanghai, and Chengdu. If the region where the user's database is located is not within these regions, it is recommended to select the nearest one.
Select Servers:
If the acquisition method is Select from List, after selecting the region, users can directly select one or more CVMs from the list.

If the acquisition method is Enter, users can add CVMs by entering one or more instance IP addresses in the text box.


Step 2: Adding Database

On the Add Database Instance page, it shows the selected CVM and its database status from the previous step.
1. On the Add Database Instance page, select Database Type.
2. Select a CVM, click Add in the Operation column, or select multiple CVMs, click Batch Add Database at the top left of the list to add databases to the CVMs.
Note:
For CVMs with the Agent successfully deployed, if no database is added, the database status is displayed as --.

3. In the pop-up dialog box, fill in the database port number, account, password, and database configuration, and click OK to complete the database addition.
Note:
If there is a database account authorization exception, see Database Account Authorization Exception.
The database account configuration instructions:
Parameter Name
Parameter Description
Port
The database port number detected by the DBbrain Agent (If there are multiple databases in the CVM, you can click Add Port to manually add the database port number to access multiple CVM self-built databases simultaneously.).
Account
The account of the CVM self-built database (If the account has not been created, you need to click Generate Authorization Command first, then copy and execute the generated authorization command on the database.).
Password
The corresponding password for the CVM self-built database.
Database Configuration
Includes CPU, memory, and disk resources allocated by the host to the CVM self-built database. DBbrain calculates performance metrics based on the provided configuration details.
The database account authorization is as follows:
Permission
Description
PROCESS
View all connection processes. It is used for displaying real-time session processes.
REPLICATION SLAVE, REPLICATION CLIENT
View the status of the primary/secondary databases, and view relaylog and binlog events of the secondary database. It is used for diagnosing primary-secondary replication exceptions.
SHOW DATABASES, SHOW VIEW, RELOAD, SELECT
Default read permissions for databases and tables, as well as refresh permissions.

4. Return to the Add Database Instance page, and click Done. Databases with a Connect normal status are successfully integrated with DBbrain's autonomous services.
5. In the left sidebar, select Instance Management, and at the top, select the corresponding self-built database type to view and manage the accessed self-built database.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback