Creating and Connecting to a TencentDB for SQL Server Instance (from Local machine)

Last updated: 2020-08-20 14:13:44

    Operation Scenario

    This document describes how to use a Linux CVM instance equipped with a public IP to map the ports, connect to an instance through SQL Server Management Studio (SSMS), and run a simple query.

    The CVM and TencentDB instances must be under the same account and in the same VPC in the same region.


    For data security considerations, TencentDB for SQL Server currently doesn't open up public IP for instances. If you need a public IP, you can use the port mapping function of SSH2 to connect to, configure, and manage your instance from the internet.

    1. On the TencentDB for SQL Server instance details page, view the private IP and port number of the instance, which will be used for configuring port mapping.
    2. Prepare a Linux CVM instance with a public IP. For more information, please see Getting Started with Linux CVM.
    3. Log in to the Linux CVM instance locally with an SSH tool such as SecureCRT (used as an example in this document) or PuTTY. For the login method, please see Logging in to Linux CVM Instances.
    4. Select Options > Session Options in the SecureCRT menu bar to enter the session properties settings page.
    5. On the session properties settings page, select Connection > Port Forwarding > Add to enter the port mapping configuration page.
    6. On the port mapping configuration page, configure the corresponding parameters.
    7. Download and install SQL Server Management Studio (SSMS) locally. For more information on SSMS, please see Use SQL Server Management Studio.
    8. Start SSMS locally. On the Connect to server page, enter the relevant information to connect to TencentDB. Click Connect and wait a few minutes before SSMS connects to your database instance.
      • Server type: select "Database Engine".
      • Server name: enter the local IP address and port number and separate them with a comma, such as,4000. The port number should be the same as that configured in step 6.
      • Authentication: select "SQL Server Authentication".
      • Login and Password: enter the account name and password you configured when creating the instance account on the Account Management page.
    9. Once connected to the database, you can view the standard built-in system databases (master, model, msdb, and tempdb) of SQL Server.
    10. Now you can start creating your own databases and running queries for them. Select File > New > Query with Current Connection and type the following SQL query:
      select @@VERSION
      Run the query. SSMS will return the TencentDB for SQL Server instance.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback