如何连接到远程SQL Server

In this article, we will explain step by step how to connect remotely to a SQL Server Express instance. Remote access is the ability to get access to a SQL Server from a remote distance in order to manipulate data which are located on that SQL Server.

在本文中,我们将逐步解释如何远程连接到SQL Server Express实例。 远程访问是一种能够远程访问SQL Server以便处理位于该SQL Server上的数据的能力。

There are two types of adjustments which must be set before connecting to the remote SQL Server. These settings are important because without them the connection to the remote SQL Server will not be able to be successfully created

连接到远程SQL Server之前,必须设置两种调整类型。 这些设置很重要,因为没有它们,将无法成功创建到远程SQL Server的连接。

Configuration settings:

配置设置:

  1. The SQL Server instance to allow the protocol being requested

    SQL Server实例以允许请求协议
  2. Allow access through the Window Firewall

    允许通过窗口防火墙访问

In order to allow access to SQL Server instance, we have to enable TCP/IP protocol which is not enabled by default. TCP/IP (Transmission Control Protocol/Internet Protocol) is a set of protocols developed to allow networked computers to share resources over the network. It was developed by DARPA under the ARPANET in the early 1970s.

为了允许访问SQL Server实例,我们必须启用默认情况下未启用的TCP / IP协议。 TCP / IP(传输控制协议 / Internet协议)是一组协议,旨在允许联网的计算机通过网络共享资源。 它是由DARPAARPANET下于1970年代初期开发的。

In order to establish a successful remote connection is to set up appropriate ports through the Window Firewall. In SQL Server there are two types of instances. First is a default instance and the second is a named instance. To connect to the default instance of Database Engine, or named instance that is the only instance installed on the machine, the TCP port 1433 is the only port that you need to specify.

为了建立成功的远程连接,是通过Window防火墙设置适当的端口。 在SQL Server中,有两种类型的实例。 第一个是默认实例,第二个是命名实例。 要连接到数据库引擎的默认实例或命名实例(这是计算机上安装的唯一实例),TCP端口1433是您需要指定的唯一端口。

But if you have multiple name instances installed on your machine, to connect with one of them, we must provide a port number which corresponding to appropriate instance name. By default named instance used dynamic port, which means that every time when the Database Engine starts new port number is assigned. Because of that it is difficult to configure Windows Firewall to enable access.

但是,如果您的计算机上安装了多个名称实例,要与其中之一连接,我们必须提供与适当的实例名称相对应的端口号。 默认情况下,命名实例使用动态端口,这意味着每次数据库引擎启动时都会分配新的端口号。 因此,很难配置Windows防火墙以启用访问。

In order to resolve this problem, there is a SQL Browser service, which provide the TCP port number that corresponds to the named instances. The SQL Browser services use UDP port 1434. Now we met with the basic matters relating to remote connection, let’s continue with the setup procedure.

为了解决此问题,有一个SQL Browser服务,它提供与命名实例相对应的TCP端口号。 SQL Browser服务使用UDP端口1434。现在,我们已经了解了与远程连接有关的基本问题,让我们继续设置过程。

启用TCP / IP协议 (Enabling TCP/IP protocol )

The first step is to enable TCP/IP protocol on the SQL Server service. Open the SQL Server Configuration Manager in the Configuration Tools folder under the Microsoft SQL Server folder:

第一步是在SQL Server服务上启用TCP / IP协议。 在Microsoft SQL Server文件夹下的“ 配置工具”文件夹中打开SQL Server配置管理器

From the SQL Serve

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值