Step 4: Connect to a DB Instance Through a Public Network
You can connect to a DB instance through a common connection or an SSL connection. The SSL connection encrypts data and is more secure.
Preparations
- Bind an EIP to the target DB instance and configure security group rules.
- Bind an EIP to the target DB instance.
For details about how to bind an EIP, see section Step 2: Bind an EIP.
- Obtain the IP address of the local device.
- Configure security group rules.
Add the IP address and port obtained in 1.b to the inbound rule of the security group.
For details about how to configure a security group rule, see section Step 3: Configure Security Group Rules.
- Run the ping command to check the connectivity between the local device and the DB instance.
- Bind an EIP to the target DB instance.
- Use a database client to connect to the target DB instance.
You can use a database client to connect to the target DB instance in the Linux or Windows operating system (OS).
- In the Linux OS, you need to install a MySQL client on the ECS. It is recommended that you download a MySQL client running a version later than that of the DB instance.
For details about how to obtain and install the MySQL client, see section How Can I Install the MySQL Client?
- In the Windows OS, you can use any common database client to connect to the target DB instance in a similar way.
The database client MySQL-Front is used as an example in Using MySQL-Front to Connect to a DB Instance.
- In the Linux OS, you need to install a MySQL client on the ECS. It is recommended that you download a MySQL client running a version later than that of the DB instance.
Using MySQL-Front to Connect to a DB Instance
- Start MySQL-Front.
- In the displayed dialog box, click New.
Figure 1 Connection management
- Enter the information of the DB instance to be connected and click Ok, as shown in Figure 2.
Table 1 Parameter description Parameter
Description
Name
Indicates the name of the database connection task. If you do not set this parameter, it will be the same as the Host value by default.
Host
Indicates the EIP of the DB instance to be connected.
Port
Indicates the private network port of the DB instance.
User
Indicates the name of the user who will access the DB instance. The default user is root.
Password
Indicates the password of the RDS database account.
- In the displayed window, select the connection that you have created in Figure 3 and click Open.
If the connection information is correct, the DB instance is successfully connected.
If the connection fails, ensure that preparations have been correctly made in Preparations and try again.
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