tencent cloud

Feedback

Connecting to TencentDB for SQL Server Instance from Local Machine

Last updated: 2022-05-11 10:44:39

    Overview

    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.

    Note:

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

    Directions

    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 SQL Server Console 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 Customizing Linux CVM Configurations.
    3. Log in to the Linux CVM instance locally with an SSH tool such as SecureCRT (as demonstrated in this document) or PuTTY. For the login method, please see Logging into Linux Instance.
    4. Select Options > Session Options on 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 10.0.0.1,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.
    1. Once connected to the database, you can view the standard built-in system databases (master, model, msdb, and tempdb) of SQL Server.
    2. 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.

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support