• Relational Database Service

rds
  1. Help Center
  2. Relational Database Service
  3. User Guide
  4. Getting Started with Microsoft SQL Server
  5. Connecting to a DB Instance

Connecting to a DB Instance

You can use a Microsoft SQL Server client to connect to a DB instance through a common connection or an SSL connection. The SSL connection is encrypted and therefore more secure.

Preparations

  1. Prepare an ECS or a device that can access RDS DB instances.
    • To connect to a DB instance through an ECS, you must first create an ECS.

      To connect to a DB instance through a floating IP address, you need to add the IP address of the target DB instance to the RDS security group. For details about how to create a security group, see the "Adding a Security Group Rule" section in the Virtual Private Cloud User Guide.

      For details about how to create an ECS, see section How Can I Create and Connect to an ECS?

    • To connect to a DB instance through an EIP, you must:
      1. Bind the EIP to the DB instance. For details, see section Binding an EIP.
      2. Ensure that the device can access the EIP that has been bound to the DB instance.
  2. Install the Microsoft SQL Server client on the ECS or device that was prepared in 1. Prepare an ECS or a d....

    For details, see section How Can I Install SQL Server Management Studio?

Common Connection

  1. Log in to the ECS or device that can access RDS.
  2. Start SQL Server Management Studio.
  3. Choose Connect > Database Engine. In the displayed dialog box, enter login information.

    Figure 1 Connecting to a DB instance
    • Server name: indicates different values depending on how you intend to access the DB instance. If you intend to access the DB instance through an ECS, Server name indicates the IP address and port number of the primary DB instance. To obtain these values, go to the Instance Management page and click the target DB instance. The IP address and port number can be found in the Floating IP Address field on the Basic Information page. If you intend to access the DB instance through an EIP, -h indicates the EIP displayed in the EIP field on the Basic Information page. Use commas (,) to separate IP addresses and port numbers.
    • 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.

    For example, the following figure shows how to connect to a DB instance as user rdsuser.

    Figure 2 Connecting to a DB instance

  4. Click Connect to connect to the DB instance.

SSL Connection

  • Replace the old certificate before it expires to improve system security.
  • After you bind an EIP to a Microsoft SQL Server DB instance, you must reboot the instance to make the SSL connection work.
  1. On the Instance Management page, click the target DB instance. On the displayed Basic Information page, click Download Certificate in the SSL field to download the root certificate or certificate bundle.
  2. Upload the root certificate to the ECS or save it to the device to be connected to the DB instance.
  3. Import the root certificate to the Windows operating system on the ECS. For details, see section How Can I Import the Root Certificate to the Windows OS?
  4. Start SQL Server Management Studio.
  5. Choose Connect > Database Engine. In the displayed dialog box, enter login information. The following uses user rdsuser as an example to illustrate how to connect to the DB instance through SSL.

    1. Enter a username and password and click Options.
      Figure 3 Connecting to a DB instance through SSL
      • Server name: indicates different values depending on how you intend to access the DB instance. If you intend to access the DB instance through an ECS, Server name indicates the IP address and port number of the primary DB instance. To obtain these values, go to the Instance Management page and click the target DB instance. The IP address and port number can be found in the Floating IP Address field on the Basic Information page. If you intend to access the DB instance through an EIP, -h indicates the EIP displayed in the EIP field on the Basic Information page. Use commas (,) to separate IP addresses and port numbers.
      • 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.
    2. On the Connection Properties page, set related parameters and select Encrypt connection.
      Figure 4 Connection properties
      NOTE:

      If Encrypt connection is selected, SSL will be used to encrypt connections to a DB instance. (Encrypt connection is unselected by default.)

  6. Click Connect to connect to the DB instance.