Connecting to a DB Instance Using MySQL-Front
If your DB instance and ECS are not in the same region or VPC, you can connect to your DB instance using a Windows client through an EIP.
This section describes how to connect to a DB instance using a Windows ECS with the MySQL-Front client installed through an EIP.
Binding an EIP to a DB Instance
Querying the EIP of the DB Instance to Be Connected
Testing Connectivity and Installing MySQL-Front
Using MySQL-Front to Connect to a DB Instance
Purchasing an ECS
- Log in to the management console and check whether there is an ECS available.
- If there is a Linux ECS, see Connecting to a DB Instance Using a MySQL Client.
- If there is a Windows ECS, go to 3.
- If no ECS is available, go to 2.
- Buy an ECS and select Windows as its OS.
To download a MySQL client to the ECS, bind an EIP to the ECS.
For details about how to purchase a Windows ECS, see Purchasing an ECS in Elastic Cloud Server Getting Started.
- On the ECS Information page, view the region and VPC of the ECS.
Figure 1 Viewing ECS information
- On the Basic Information page of the DB instance, view the region and VPC of the DB instance.
Figure 2 Viewing the region and VPC of the DB instance
Binding an EIP to a DB Instance
You can bind an EIP to a DB instance for public access and unbind it as required.
If an EIP has been bound to the DB instance, skip this step.
- Log in to the management console.
- Click in the upper left corner and select a region and project.
- Click in the upper left corner of the page, choose .
- On the Instances page, click the instance name to go to the Basic Information page.
- In the Network Information area, click Bind under Public IP Address (EIP).
- In the displayed dialog box, select an EIP and click OK.
If no EIPs are available, click View EIP to create an EIP on the network console. After the EIP is created, go back to the Basic Information page and bind the newly created EIP to the instance.
You need to configure security group rules and enable specific IP addresses and ports to access the DB instance. For details, see Configuring Security Group Rules.
- In the Network Information area, locate Public IP Address (EIP) and view the bound EIP.
Querying the EIP of the DB Instance to Be Connected
- Log in to the management console.
- Click in the upper left corner and select a region and project.
- Click in the upper left corner of the page, choose .
- On the Instances page, click the instance name to go to the Basic Information page.
- In the Network Information area, obtain the EIP and database port.
Figure 3 Viewing the EIP and database port
Testing Connectivity and Installing MySQL-Front
- Open the cmd window on your local server and check whether the EIP and database port of the DB instance can be connected.
telnet EIP 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 normal.
- If no, check the security group rules.
- If in the security group of the ECS, there is no outbound rule with Destination set to 0.0.0.0/0 and Protocol & Port set to All, add an outbound rule for the EIP and port of the DB instance.
Figure 4 Configuring rules of an ECS security group
- On the Inbound Rules page of the DB instance security group, add an inbound rule for the EIP and port of the ECS.. For details, see Configuring Security Group Rules.
- If in the security group of the ECS, there is no outbound rule with Destination set to 0.0.0.0/0 and Protocol & Port set to All, add an outbound rule for the EIP and port of the DB instance.
- Open a browser, and download and install the MySQL-Front tool locally (version 5.4 is used as an example).
Using MySQL-Front to Connect to a DB Instance
- Start MySQL-Front.
- In the displayed dialog box, click New.
Figure 5 Creating a connection
- Enter the information about the DB instance to be connected and click Ok.
Figure 6 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.
- In the displayed window, select the connection that you created and click Open.
Figure 7 Opening a connection
- Check whether the DB instance has been connected. If the connection information is correct, the DB instance has been connected.
Figure 8 Login succeeded
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot