Connecting to a DB Instance from a Windows ECS
You can connect to your DB instance using a Windows ECS with SQL Server Management Studio installed over a private network.
You can connect to a DB instance through a non-SSL connection or an SSL connection using an RDS for SQL Server client. The SSL connection encrypts data and is more secure.
Preparations
- Prepare an ECS.
To connect to a DB instance through a private network, you must first create an ECS.
- The ECS and RDS DB instance must be in the same VPC.
- The ECS must be allowed by the security group to access RDS DB instances.
- If the security group with which the target DB instance is associated is the default security group, you do not need to configure security group rules.
- If the security group with which the target DB instance is associated is not the default security group, check whether the security group rules allow the ECS to connect to the DB instance.
- Log in to the management console.
- Click
in the upper left corner and select a region and a project.
- Click Service List. Under Database, click Relational Database Service.
- On the Instances page, click the target DB instance.
- In the Connection Information area, click the security group to view its rules.
If the security group rules allow the access from the ECS, the ECS can connect to the DB instance.
If the security group rules do not allow the access from the ECS, you need to add a security group rule. For details, see Configuring Security Group Rules.
- Install an RDS for SQL Server client.
Install an RDS for SQL Server client on the ECS or device that was prepared in 1.
Non-SSL Connection
- Log in to the ECS or device that can access RDS.
- Start SQL Server Management Studio.
- Choose Connect > Database Engine. In the displayed dialog box, enter login information.
Figure 1 Connecting to the server
- Server name: indicates the IP address and port of the DB instance. Use a comma (,) to separate them. For example: x.x.x.x,8080.
- The IP address is the floating IP address in the Connection Information area on the Basic Information page of the DB instance.
- The port is the database port in the Connection Information area on the Basic Information page of the DB instance.
- Authentication: indicates the authentication mode. Select SQL Server Authentication.
- Login: indicates the RDS database username. The default administrator is rdsuser.
- Password: indicates the password of the RDS database username.
- Server name: indicates the IP address and port of the DB instance. Use a comma (,) to separate them. For example: x.x.x.x,8080.
- Click Connect to connect to the DB instance.Note
If the connection fails, ensure that preparations have been correctly made in Preparations and try again.
SSL Connection
- Download the SSL root certificate and then upload it.
- In the DB Information area on the Basic Information page, click
in the SSL field to download the root certificate or certificate bundle.
- Import the root certificate to the Windows ECS. For details, see How Do I Import the SSL Certificate of an RDS Instance to a Windows or Linux Server?Note
- Replace the old certificate before it expires to improve system security.
- After you bind an EIP to a DB instance, you must reboot the instance for the SSL connection to take effect.
- In the DB Information area on the Basic Information page, click
- Start SQL Server Management Studio.
- Choose Connect > Database Engine. In the displayed dialog box, enter login information.
Figure 2 Connecting to the server
- Server name: indicates the IP address and port of the DB instance. Use a comma (,) to separate them. For example: x.x.x.x,8080.
- The IP address is the floating IP address in the Connection Information area on the Basic Information page of the DB instance.
- The port is the database port in the Connection Information area on the Basic Information page of the DB instance.
- Authentication: indicates the authentication mode. Select SQL Server Authentication.
- Login: indicates the RDS database username. The default administrator is rdsuser.
- Password: indicates the password of the RDS database username.
- Server name: indicates the IP address and port of the DB instance. Use a comma (,) to separate them. For example: x.x.x.x,8080.
- Click Options. On the Connection Properties page, enter related parameters and select Encrypt connection to enable SSL encryption. (By default, Encrypt connection is not selected. You need to select it manually.)
Figure 3 Connection properties
- Click Connect to connect to the DB instance.Note
If the connection fails, ensure that preparations have been correctly made in Preparations and try again.
- Preparations
- Non-SSL Connection
- SSL Connection