客户端远程连接到 SQL Server 需要什么?

What does a client need to connect remotely to an SQL Server?(客户端远程连接到 SQL Server 需要什么?)
本文介绍了客户端远程连接到 SQL Server 需要什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我已在我的家用计算机上设置了 Microsoft SQL Server 2008 R2 Express.我的家用电脑装有 Windows 7,并在路由器后面.我配置它我觉得没问题,因为我可以通过管理工作室从工作中联系到他.意思是 - 我打开了所有必要的端口,我配置了 SQL 以接受 TCP 上的连接.我也在我的路由器上设置了 DynDNS 并且我通过我的 DNS 名称连接并且它工作正常.

i have set up a Microsoft SQL Server 2008 R2 Express on my home computer. My home computer has Windows 7 and is behind a router. I configured it i think ok, because i can connect to him from work through management studio. Means - i opened all necessary ports, i configured SQL to accept connections on TCP. I have also on my router set up DynDNS and i connect through my DNS name and it works.

我还使用 Microsoft PortQueryUI [ http://www.microsoft.com/download/en/details.aspx?id=24009 ] 来测试服务器是否可见,从我的工作计算机是否可见.我的 PortQueryUI 工作输出正常(附上),但其他网络的人无法连接到我的服务器.他们在测试端口 1434 UDP(大粗体)时出现错误代码 0x00000002,我认为它是正确的 - 0x00000000.

I use also Microsoft PortQueryUI [ http://www.microsoft.com/download/en/details.aspx?id=24009 ] to test if the server is visible and from my work computer and it is visible. My PortQueryUI output at work is ok (attached bloew) but people from other networks cannot connect to my server.They have in the test to port 1434 UDP (big bold) an error code 0x00000002 where i have it correct - 0x00000000.

这是什么原因,有什么需要在他们的电脑上做的吗?也许他们的网络阻止了某些东西?

What is the reason, is there something that needs to be done on their computers? Maybe their network is blocking something?

我的 PortQueryUI 工作输出:

My PortQueryUI output from work:

    =============================================

 Starting portqry.exe -n myhome.dyndns.net -e 1434 -p UDP ...


Querying target system called:

 myhome.dyndns.net

Attempting to resolve name to IP address...


Name resolved to 83.xxx.xxx.xxx

querying...

UDP port 1434 (ms-sql-m service): LISTENING or FILTERED

Sending SQL Server query to UDP port 1434...

Server's response:

ServerName ROBERT-KOMPUTER
InstanceName SQL2008R2
IsClustered No
Version 10.50.1600.1
tcp 1433
np \\ROBERT-KOMPUTER\pipe\MSSQL$SQL2008R2\sql\query



==== End of SQL Server query response ====

UDP port 1434 is LISTENING
portqry.exe -n myhome.dyndns.net -e 1434 -p UDP exits with return code 0x00000000.
=============================================

 Starting portqry.exe -n myhome.dyndns.net -e 1433 -p TCP ...


Querying target system called:

 myhome.dyndns.net

Attempting to resolve name to IP address...

Name resolved to 83.xxx.xxx.xxx

querying...

TCP port 1433 (ms-sql-s service): LISTENING
portqry.exe -n myhome.dyndns.net -e 1433 -p TCP exits with return code 0x00000000.

推荐答案

确保端口 1433 在 SQL 所在的防火墙上打开,为了安全起见,您可能也应该在其上设置某种 IP 范围/范围.

Make sure port 1433 is open on your firewall where SQL is, you should probably put some sort of IP range/scope on that too for security.

您需要在数据库属性中将数据库设置为接受远程连接.您需要设置用户名和密码并授予其访问数据库的权限,以便您的远程连接能够识别它.

You need to set your database to Accept Remote Connections in the DB properties. You need to setup a username and password and give it access to the database so your remote connection recognizes it.

以下是允许连接的示例:

Here's an example of allowing the connection:

http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

以下是连接示例:

http://www.youtube.com/watch?v=hT9p_FPt720

这篇关于客户端远程连接到 SQL Server 需要什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Query with t(n) and multiple cross joins(使用 t(n) 和多个交叉连接进行查询)
Unpacking a binary string with TSQL(使用 TSQL 解包二进制字符串)
Max rows in SQL table where PK is INT 32 when seed starts at max negative value?(当种子以最大负值开始时,SQL 表中的最大行数其中 PK 为 INT 32?)
Inner Join and Group By in SQL with out an aggregate function.(SQL 中的内部连接和分组依据,没有聚合函数.)
Add a default constraint to an existing field with values(向具有值的现有字段添加默认约束)
SQL remove from running total(SQL 从运行总数中删除)