tencent cloud

TencentDB for SQL Server

Release Notes and Announcements
Release Notes
Product Announcements
User Guide
Product Introduction
Overview
Product Architecture
Strengths
Use Cases
Regions and AZs
Major Version Lifecycle Explanation
Features and Differences
Instance Types
Instance Specifications
Storage Types
Common Concepts
Network Environment
License Statement
Purchase Guide
Billing Overview
Product Pricing
Purchase Methods
Renewal Instructions
Payment Overdue
Refund
From Pay-as-You-Go to Monthly Subscription
Instance Adjustment Fees Description
Local Backup Space Billing
Cross-Region Backup Billing
Viewing Bill Details
Getting Started
Creating TencentDB for SQL Server Instance
Connecting to TencentDB for SQL Server Instance
Managing TencentDB for SQL Server Instance
Operation Guide
Constraints and Limits
Usage Specifications and Suggestions
Maintaining Instance
Adjusting Instance Configuration
Read-Only Instance
Network and Security
Account Management
Database Management
Data Security
Parameter Configuration
Monitoring and Alarms
Backup and Restoration 
Log Management
Publish-Subscribe
SSIS
Data Migration (New)
Data Migration (Legacy)
Data Synchronization (DTS) 
Practical Tutorial
TencentDB for SQL Server Methods for Regular Maintenance
TencentDB for SQL Server Optimization of Slow SQL
How to Better Use Tempdb
Cross-Account Backup Restoration
Creating VPC for TencentDB for SQL Server
Connecting Kingdee K/3 WISE to TencentDB for SQL Server
Account Permissions and Permission Control
Enabling and Disabling the CDC Feature
Shrinking a Database
API Documentation
History
Introduction
API Category
Making API Requests
Sales and fee related APIs
Instance Management related APIs
Operation and maintenance management related APIs
Network management related APIs
Account management related APIs
Database management related APIs
Security group management related APIs
Data security encryption related APIs
Parameter configuration related APIs
Extended Event related APIs
Log management related APIs
Read only instance management related APIs
Publish and subscribe related APIs
Backup related APIs
Rollback related APIs
Data migration (cold standby migration) related APIs
SQL Server Integration Services (SSIS) related APIs
Data migration (DTS old version) related APIs
Data Types
Error Codes
FAQs
Overview
Model Selection
Pricing and Selection
Connection and Network
Account and Permission
Backup and Rollback
Data Migration
Publish/Subscribe
Read-Only Instance
Version and Architecture Upgrade
Disk Space and Specification Adjustment
Monitoring and Alarms
Log-Related
Parameter Modification
Features
Performance, Space, and Memory-Related FAQs
Service Agreement
Service Level Agreement
Terms of Service
Performance Evaluation
Performance Test Report
Glossary
Contact Us

Connecting to TencentDB for SQL Server Instance from Local System

PDF
Focus Mode
Font Size
Last updated: 2024-11-13 20:00:03
This document describes how to connect to a TencentDB for SQL Server instance through SQL Server Management Studio (SSMS), and run a simple query.

Connection scenarios

The connection methods vary by TencentDB instance type: You can connect to a two-node TencentDB for SQL Server instance (formerly high-availability edition/cluster editions) from a local system in the following three methods:
Option 1: Use VPN, or Direct Connect, or CCN for interconnection, which are more secure and stable.
Option 2: Connect to the instance over the public network by enabling the public network address or binding the instance to CLB to enable public network access in the console.
You can connect to a single-node TencentDB for SQL Server instance (formerly basic edition) from a local system in the following three methods:
Option 1: Use VPN, or Direct Connect, or CCN for interconnection, which are more secure and stable.
Option 2: Connect to the instance over the public network by enabling the public network address in the console.
The following are connection options:
Enabling the public network address in the console and connecting to the TencentDB for SQL Server instance from a local system through SSMS.
Binding the TencentDB for SQL Server instance to CLB and connecting to the instance from a local system through SSMS.
Using a Linux CVM instance with a public IP to map the ports and connecting to the instance from a local system through SSMS

Enabling the public network address in the console and connecting to the TencentDB for SQL Server instance from a local system through SSMS

Step 1. Enable the public network address

2. Select the region and click the ID or Manage in the Operation column of the target instance in the instance list.
3. In the Instance Info on the Instance Details page, click Enable next to the Public Network Address.
4. In the Enabling public network window, read the note, indicate your consent, and click OK.
5. After public network access is enabled, view the public IP address and port number of the instance in Basic Info on the Instance Details tab.
Note:
For the detailed notes and steps of enabling public network access, see Enabling/Disabling Public Network Address.

Step 2. Connect to the TencentDB for SQL Server instance over the public network

1. Download and install SQL Server Management Studio locally. For more information on SSMS, see Using SQL Server Management Studio.
2. 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 public IP address and port number of the instance and separate them by comma.
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.


3. Once connected to the database, you can view the standard built-in system databases (master, model, msdb and tempdb) of SQL Server.


4. 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 returns the TencentDB for SQL Server instance.



Binding the TencentDB for SQL Server instance to CLB to enable public network access and connecting to the instance from a local system through SSMS

Step 1. Purchase a CLB instance

Note:
If you already have a CLB instance in the same region as TencentDB for SQL Server, skip this step.
Go to the CLB purchase page, select the configuration, and click Buy Now.
Note:
Region: You need to select the region where the TencentDB for SQL Server instance is.
Network: You can select the same VPC as the instance or a different one.

Step 2. Configure CLB Configuration

1. Enable cross-VPC access (you can skip this step if the CLB instance and TencentDB for SQL Server instance are in the same VPC) a. Log in to the CLB Console, select the region, and click the instance ID in the instance list to enter the management page. b. On the Basic information page, click Configure in the Backend server section. c. In the pop-up window, click Submit.
2. Configure a public network listener port a. Log in to the CLB Console, select the region, and click the instance ID in the instance list to enter the management page. b. On the instance management page, select the Listener management tab and click Create below TCP/UDP/TCP SSL/QUIC listener.

c. In the pop-up window, complete the settings and click Submit.


Step 3. Bind a TencentDB for SQL Server instance

1. After creating the listener, click it in Listener management and click Bind on the right.

2. In the pop-up window, select Other Private IPs as the object type, enter the IP address and port of the TencentDB for SQL Server instance, and click OK.
Note:
The login account must be a standard account (bill-by-IP). If binding fails, submit a ticket for assistance.

Step 4. Configure the TencentDB for SQL Server security group

1. Log in to the TencentDB for SQL Server console. Select a region, click an instance ID in the instance list or Manage in the Operation column to access the instance management page.
2. On the instance management page, select the Security Group tab, click Configure Security Group, configure the security group rule to open all ports, and confirm that the security group allows access from public IPs. For more information on configuration, see Configuring Security Group.

Step 5. Connect to the TencentDB for SQL Server instance over the public network

1. Download and install SQL Server Management Studio locally. For more information on SSMS, please see Using SQL Server Management Studio.
2. 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 of the CLB instance and separate them by a comma, such as 10.0.0.1,4000.
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.


3. Once connected to the database, you can view the standard built-in system databases (master, model, msdb and tempdb) of SQL Server.


4. 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 returns the TencentDB for SQL Server instance.



Using a linux CVM instance with a public IP to map the ports and connecting to the instance from a local system through SSMS

Note:
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 doesn't support public IP. If you need to use a public IP, you can use the port mapping feature of SSH2 to connect to, configure, and manage an instance from the internet.
1. Log in to the TencentDB for SQL Server console. View the private IP and port number of the instance on the Instance Details page. The private IP and port number will be used for port mapping configuration.

2. Prepare a Linux-based CVM instance with a public IP. For more information , 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). For the login method, see Logging in to Linux Instance (Web Shell).
4. Select Options > Session Options in the SecureCRT menu bar to enter the session properties settings.


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, 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.


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 returns the TencentDB for SQL Server instance.



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback