Updated on 2023-10-18 GMT+08:00

Connecting to a DB Instance from a Windows ECS

You can connect to your DB instance using a Windows ECS with a database client (for example, MySQL-Front) installed over a private IP address.

  1. Purchasing an ECS
  2. Querying the Private IP Address of the DB Instance to Be Connected
  3. Testing Connectivity and Installing MySQL-Front
  4. Using MySQL-Front to Connect to a DB Instance

Purchasing an ECS

  1. Log in to the management console and check whether there is an ECS available.

  2. Buy an ECS and select Windows as its OS.

    To download a MySQL client to the ECS, bind an EIP to the ECS. The ECS must be in the same region, VPC, and security group as the GaussDB(for MySQL) DB instance for mutual communication.

    For details about how to purchase a Windows ECS, see "Purchasing an ECS" in Elastic Cloud Server User Guide.

  3. On the ECS Information page, view the region and VPC of the ECS.

  4. On the Basic Information page of the GaussDB(for MySQL) DB instance, view the region and VPC of the DB instance.
  5. Check whether the ECS and GaussDB(for MySQL) DB instance are in the same region and VPC.

    • If yes, go to Querying the Private IP Address of the DB Instance to Be Connected.
    • If no, purchase another ECS or DB instance. If the ECS and DB instance are in different regions, they cannot communicate with each other. To reduce network latency, deploy your DB instance in the region nearest to your workloads.
    • If the ECS and DB instance are in different VPCs, change the VPC of the ECS to that of the DB instance. For details, see "Changing a VPC" in the Elastic Cloud Server User Guide.

Querying the Private IP Address of the DB Instance to Be Connected

  1. Log in to the management console.
  2. On the Instances page, click the instance name to go to the Basic Information page.
  3. In the Network Information area, obtain the private IP address and database port.

Testing Connectivity and Installing MySQL-Front

  1. Log in to the ECS. For details, see "Login Using VNC" in the Elastic Cloud Server User Guide.
  2. On the ECS, check whether the private IP address and database port of the DB instance (obtained in Querying the Private IP Address of the DB Instance to Be Connected) can be connected.

    telnet private IP address port

    Example:

    telnet 192.168.0.16 3306

    If the message "command not found" is displayed, install the Telnet tool based on the OS used by the ECS.

    • If yes, network connectivity is available.
    • If no, check the security group rules.
      • If Destination is not 0.0.0.0/0 and Protocol & Port is not All on the Outbound Rules page of the ECS, add the private IP address and port of the DB instance to the outbound rules.
      • To view the inbound rules of the GaussDB(for MySQL) security group, add the private IP address and port of the ECS to the inbound rules. For details, see Configuring Security Group Rules.

  3. Open a browser, and download and install the MySQL-Front tool on the ECS.

Using MySQL-Front to Connect to a DB Instance

  1. Start MySQL-Front.
  2. In the displayed dialog box, click New.

    Figure 1 Connection management

  3. Enter the information of the DB instance to be connected and click Ok.

    Figure 2 Adding an account
    Table 1 Parameter description

    Parameter

    Description

    Name

    Database connection task name. If you do not specify this parameter, it will be the same as that configured for Host by default.

    Host

    Private IP address.

    Port

    Database port. The default value is 3306.

    User

    Account name of the DB instance. The default value is root.

    Password

    Password of the account for accessing the DB instance.

  4. In the displayed window, select the connection that you have created in 3 and click Open. If the connection information is correct, the DB instance is successfully connected.

    Figure 3 Opening a session