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.
- 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.
- Prepare a Linux CVM instance with a public IP. For more information, please see Getting Started with Linux CVM.
- 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.
- Select Options > Session Options in the SecureCRT menu bar to enter the session properties settings page.
- On the session properties settings page, select Connection > Port Forwarding > Add to enter the port mapping configuration page.
- On the port mapping configuration page, configure the corresponding parameters.
- Download and install SQL Server Management Studio (SSMS) locally. For more information on SSMS, please see Use SQL Server Management Studio.
- 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.
- Once connected to the database, you can view the standard built-in system databases (master, model, msdb, and tempdb) of SQL Server.
- 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:
Run the query. SSMS will return the TencentDB for SQL Server instance.