Home > News list > Programming/Database >> Database Operation Tutorial

Remote access to local SQL from another location; Server Database

Database Operation Tutorial 2023-05-12 12:11:15 Source: Network

catalogue1. Introduction2

1. Introduction

I believe everyone understands the importance of databases. As electronic folders for various types of data, they may contain various information, ranging from employee information to website access or transaction data. In some scenarios, databases have become an essential condition for the normal operation of enterprises. Like other tasks in the enterprise, databases also require necessary maintenance. But after the test of the mask era, it is necessary to set up a remote operation for your own database. Today, the author will introduce to you how to use CPolar intranet penetration, remote connection, and operation of SQL Server.

2. Local installation and setup of SQL Server

Microsoft SQLServer is a well-known relational database management software. Although it is not the most widely used, it is produced by Microsoft and has good compatibility with its own Windows operating system. Therefore, it is suitable for application on various hardware installed with Windows operating system and assumes the responsibility of data management software.

2.1 SQL Server Download

Due to SQL Server being produced by Microsoft, it is easy to find downloads on Microsoft's official website https://www.microsoft.com/en-us/sql-server/sql-server-downloads

Click on the required version to download (I have chosen Developer), double-click on the downloaded. exe file, and you can proceed with automatic installation.

stayInstallation modestaybasicInstallation mode

Next is the journeyNextTo complete the installation program

2.2 SQL Server Local Connection Testing

SQL ServerstayConnect NowButton.

At this point, the SQLCMD command line window will pop up. As long as the displayed content is as shown in the following figure, it indicates that our local SQL Server installation is complete.

2.3 Download and installation of Cpolar intranet penetration

Next, we will continue to install the key software for remote connection to SQL Server: Cpolar. Like Microsoft SQL Server, we can log in to Cpolar's official website (www.cpolar. com), click the download button at the top of the homepage, and enter the cpolar download page to download the required version of the cpolar software. Of course, we will choose the Windows version for download here.

After downloading Cpolar, unzip the downloaded file and click on the. msi file to enter the CPolar automatic installation program. All the wayNextYou can complete the installation.

Registration of 2.4Cpolar intranet penetration

cpolarestablishtokenstaycpolarcpolar

3. Local webpage publishing

staySQL ServercpolarcpolarestablishSQL ServerSQL Server

It should be noted that the data tunnel addresses set by the CPolar free version are reset every 24 hours, while the VIP version can create long-term stable and unchanging data tunnel addresses. But we don't know when we will need to remotely connect to the database (I have suffered a big loss due to the temporary control of the epidemic), so I will upgrade CPolar to the VIP version in order to create a long-term stable data tunnel.

3.1 Cpolar Cloud Settings

cpolarstay“”Page.

staycpolarReserved TCP addressField, set a public network address for the SQL Server we want to connect to. This address can be seen as the entrance of a data tunnel or understood as a blank data tunnel (after all, the tunnel entrance set here does not have an output port associated with the local software).

stayReserved TCP addressWe only need to make two simple settings for the fields:

  • stay
  • Description: Can be seen as an annotation for this data tunnel, as long as it is easy to distinguish

After completing these two settings, you can click on the&quo; on the right side; Keep&# quo; Button to fix the entrance of this data tunnel.

staycpolarx

cpolarcpolarstay

3.2 Cpolar Local Settings

cpolarstaylocalhost9200staycpolarTunnel managementUnderestablishcpolarestablishSQL Server

Of course, to create a data tunnel, you still need to make some settings, specifically:

  • Tunnel name: This column can also be seen as a note for data tunnels, used to distinguish them from other locally created tunnels. Here, we enter Microsoft SQL;
  • Protocol: This column is an application scenario for intranet penetration, such as publishing web pages, data transmission, hardware interconnection, etc. In this example, TCP protocol is selected;
  • Local address: This column needs to be filled with the output port number of SQL Server, which is port 1433 (the default port number of SQL Server);
  • Port type: This column mainly indicates the duration of data tunnel penetration through the internal network. For long-term use, select a fixed TCP port; If it is only for testing or temporary use, choose a random temporary TCP port (it should be noted that the fixed TCP port needs to be upgraded to the Professional version or above)
  • Reserved TCP address: This field is limited to selecting&quo; Fixed TCP Port; For users, if&quo; is checked; Random Temporary TCP Port” Option, the field will not appear. Fill in the fixed TCP port address that we just successfully reserved.

 stayestablishButton to connect the blank data tunnel reserved in the CPolar cloud to the local SQL output port.

establishcpolarTunnel managementUnderTunnel ListPage.

staystaystay

4. Public network access testing

After completing the settings for the CPolar client, we can clickstateUnderstayTunnel ListPage, find the address for remote access to the local SQL Server (i.e. tunnel entrance), and paste this address into different remote database management software to connect to the local SQL Server.

For example, on the Windows command line (the first TCP://of the public network address does not need to be copied)

Sqlcmd-s public address: public port number

NavicatstayhostField, fill in the address generated by cpolar (remove the first TCP://and replace the colon before the port number at the end)Change to comma

SSMSstaycpolarServer Nametcp://“”Change to comma“”SQL Server

5. Conclusion

At this point, we have completed the setup of logging in to the local Microsoft SQL Server remotely, and using the address generated by cpolar, we can log in to the SQL Server from multiple database management software, greatly increasing the convenience of our work.

That's all for this article on remote access to local SQL Server databases from different locations. For more information on remote access to SQL Server databases, please search for previous articles or continue browsing related articles below. We hope everyone can support Script Home more in the future!

Tag: Remote access to local SQL from another location Server


Disclaimer: The content of this article is sourced from the internet. The copyright of the text, images, and other materials belongs to the original author. The platform reprints the materials for the purpose of conveying more information. The content of the article is for reference and learning only, and should not be used for commercial purposes. If it infringes on your legitimate rights and interests, please contact us promptly and we will handle it as soon as possible! We respect copyright and are committed to protecting it. Thank you for sharing.

AdminSo

http://www.adminso.com

Copyright @ 2007~2024 All Rights Reserved.

Powered By AdminSo

Open your phone and scan the QR code on it to open the mobile version


Scan WeChat QR code

Follow us for more hot news

AdminSo Technical Support