Updated on 2025-08-21 GMT+08:00

Connection Methods

Before connecting to a DB instance, you must buy one first. For details about how to buy a DB instance, see Buying a DB Instance. After buying a DB instance, you can connect to it through a MySQL command-line interface (CLI), graphical user interface (GUI), Java database connectivity (JDBC), or Data Admin Service (DAS). For details about the address and scenario of each connection method, see Table 1. For details about the differences between the private and public addresses, see Connection Address Description.

Connection Methods

Table 1 Connection methods

Connection Method

Connection Address

Scenario

Comments

DAS

Not required

Huawei Cloud DAS makes DB instance management secure and efficient from a web-based console. You can connect to and manage DB instances through DAS. The permission required for remotely connecting to DB instances through DAS has been enabled for you by default. Using DAS to connect to your DB instance is recommended, which is more secure and convenient.

  • Easy to use, secure, advanced, and intelligent
  • Recommended

MySQL CLI

Private network

Private IP address

A private IP address is provided by default.

When your applications are deployed on an ECS that is in the same region and VPC as your TaurusDB instance, you are advised to connect the ECS to the instance over a private IP address.

  • Secure and excellent performance
  • Recommended

Public network

EIP

If you cannot access your TaurusDB instance over a private IP address, bind an EIP to the instance and connect it to the ECS (or a public network host) over the EIP.

  • Less secure
  • To achieve a higher data transmission rate and security level, migrate your applications to an ECS that is in the same VPC as your TaurusDB instance and use a private IP address to access the instance.

MySQL-Front

EIP

MySQL-Front is a Windows front end for MySQL databases. It allows you to interact with MySQL databases through a GUI, including connecting to a database, running SQL commands, and managing tables and records.

-

Applications

JDBC

Private IP address or EIP

You can access DB instances through JDBC.

-

Python

Private IP address or EIP

You can access DB instances through Python.

-

Connecting to a DB Instance over a Private or Public Network Using CLI

Table 2 lists how to use a CLI to connect to a TaurusDB instance over a private or public network.

Figure 1 Connecting to a DB instance over a private or public network
Table 2 Connecting to a DB instance over a private or public network

Connection Method

IP Address

Security Group Rule

Comments

Private network

Private IP address

  • If the ECS and TaurusDB instance are in the same security group, they can communicate with each other over a private network by default. No security group rules need to be configured.
  • If they are in different security groups, configure security group rules for them, separately.
    • TaurusDB instance: Configure an inbound rule for the security group that the TaurusDB instance is associated with. For details, see Configuring Security Group Rules.
    • ECS: The default security group rule allows all outbound data packets. In this case, you do not need to configure a security group rule for the ECS. If not all outbound traffic is allowed in the security group, you need to configure an outbound rule for the ECS.
  • Secure and excellent performance
  • Recommended

Public network

You need to purchase an EIP. For pricing details, see EIP Billing.

To access a DB instance from resources outside the security group that the DB instance is associated with, you need to configure an inbound rule for the security group. For details, see Configuring Security Group Rules.

  • Less secure
  • To achieve a higher data transmission rate and security level, migrate your applications to an ECS that is in the same VPC as your TaurusDB instance and use a private IP address to access the instance.

Connection Address Description

  • Private IP address

    This IP address is always bound to the primary node. If your applications are deployed on a server that is in the same VPC as your DB instance, you can connect to the DB instance using this IP address to perform read and write operations. If a failover occurs, this IP address will be bound to the new primary node and can still be used for read and write operations.

    Figure 2 Private IP address

  • Public IP address (EIP)

    After you buy a DB instance and bind an EIP to it, you can use this IP address to perform read and write operations on the DB instance. Just like a private IP address, an EIP is always bound to the primary node for read and write operations.

    Figure 3 Public IP address (EIP)