如何从另一台计算机连接到 SQL Server?
我想使用 SQL Server 2005 从家里连接到另一台 PC。
我查看了 msd...但在连接之前它说我应该连接到另一台计算机 使用计算机管理但没有成功......我只能连接到我的工作组中的计算机?
谢谢, 路易莎
I want to connect from home using SQL Server 2005 to another PC.
I had a look on the msd...but before connecting it says I should connect to another computer
using the computer management and it didn't work out....I can only connect to computers from my workgroup?
Thanks,
Luisa
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
免责声明
这只是一些可能对任何人都有帮助的附加信息。我想非常清楚地表明,我在这里描述的内容可能是:
我不是 DBA,但每次我发现自己设置 SQL Server(Express 或 Full)进行测试或其他什么情况时,我都会遇到连接问题。我描述的解决方案更适合那些只是想完成工作的人 - 在设置生产服务器时咨询该领域知识渊博的人。
对于 SQL Server 2008 R2,这就是我最终要做的事情:
教程 其中与上面发布的教程相同,作为“Dani”的解决方案,作为该问题的选定答案。
通常在我做了上面提到的事情之后我就不再有问题了。下面是最后一步要查找的内容的屏幕截图:
同样,如果了解有关此主题的更多信息的人看到危险信号,请纠正我。
Disclamer
This is just some additional information that might help anyone. I want to make it abundantly clear that what I am describing here is possibly:
I am not a DBA, but every time I find myself setting up a SQL Server (Express or Full) for testing or what not I run into the connectivity issue. The solution I am describing is more for the person who is just trying to get their job done - consult someone who is knowledgeable in this field when setting up a production server.
For SQL Server 2008 R2 this is what I end up doing:
tutorial which is the same tutorial posted above as a solution by "Dani" as the selected answer to this question.
Usually after I do what I mentioned above I don't have a problem anymore. Here is a screenshot of what to look for - for that last step:
Again, if someone with more information about this topic sees a red flag please correct me.
如果您想远程连接到 SQL Server,您需要使用 Sql Server Management studio 等软件。
计算机不需要位于同一网络上 - 但它们必须能够使用 tcp/ip 等通信协议相互连接,并且必须将服务器设置为支持您选择类型的传入连接。
如果您想连接到另一台计算机(浏览文件?),您可以使用其他工具,而不是 sql server(您可以映射驱动器并通过那里访问它等...)
要使用 tcp/ip 启用 SQL 连接,请阅读这篇文章:
对于 Sql Express:express
对于 Sql 2008:2008
确保通过计算机防火墙启用访问出色地。
您可能需要在用于连接服务器的计算机上安装 SSMS 或 Toad。您都可以从他们的公司网站下载。
If you want to connect to SQL server remotly you need to use a software - like Sql Server Management studio.
The computers doesn't need to be on the same network - but they must be able to connect each other using a communication protocol like tcp/ip, and the server must be set up to support incoming connection of the type you choose.
if you want to connect to another computer (to browse files ?) you use other tools, and not sql server (you can map a drive and access it through there ect...)
To Enable SQL connection using tcp/ip read this article:
For Sql Express: express
For Sql 2008: 2008
Make sure you enable access through the machine firewall as well.
You might need to install either SSMS or Toad on the machine your using to connect to the server. both you can download from their's company web site.
我将根据提供的进一步信息编辑我之前的答案。您可以清楚地 ping 远程计算机,因为您可以使用终端服务。
我感觉 1433 端口被防火墙阻止了,所以给你带来了麻烦。请参阅 Microsoft 的通过防火墙与 SQL Server 通信所需的 TCP 端口。
尝试使用此应用程序来 ping 您的服务器 IP 地址和端口 1433。
看看您是否从 tcping 获得“端口已打开”响应。
好的,接下来要尝试的是检查 SQL Server。 RDP 到 SQL Server 计算机。启动SSMS。连接到数据库。在对象资源管理器(通常停靠在左侧)中,右键单击服务器,然后单击属性。
替代文本 http://www.hicrest.net/server_prop_menu.jpg
转到连接设置并确保“允许远程连接到此服务器”是票证。
替代文本 http://www.hicrest.net/server_properties.jpg
I'll edit my previous answer based on further info supplied. You can clearely ping the remote computer as you can use terminal services.
I've a feeling that port 1433 is being blocked by a firewall, hence your trouble. See TCP Ports Needed for Communication to SQL Server Through a Firewall by Microsoft.
Try using this application to ping your servers ip address and port 1433.
And see if you get a "Port is open" response from tcping.
Ok, next to try is to check SQL Server. RDP onto the SQL Server computer. Start SSMS. Connect to the database. In object explorer (usually docked on the left) right click on the server and click properties.
alt text http://www.hicrest.net/server_prop_menu.jpg
Goto the Connections settings and make sure "Allow remote connections to this server" is ticket.
alt text http://www.hicrest.net/server_properties.jpg
以上所有答案都会对您有所帮助,但您必须在安装 SQL Server 的 PC 的防火墙中添加三个端口。
在 Windows 防火墙中添加新的 TCP 本地端口,端口号为 1。 1434
为 SQL Server 添加新程序并选择 sql server.exe
路径:C:\ProgramFiles\Microsoft SQL
Server\MSSQL10.MSSQLSERVER\MSSQL\Binn\sqlservr.exe
为 SQL Browser 添加新程序并选择 sqlbrowser.exe
路径:C:\ProgramFiles\Microsoft SQL Server\90\Shared\sqlbrowser.exe
all of above answers would help you but you have to add three ports in the firewall of PC on which SQL Server is installed.
Add new TCP Local port in Windows firewall at port no. 1434
Add new program for SQL Server and select sql server.exe
Path: C:\ProgramFiles\Microsoft SQL
Server\MSSQL10.MSSQLSERVER\MSSQL\Binn\sqlservr.exe
Add new program for SQL Browser and select sqlbrowser.exe
Path: C:\ProgramFiles\Microsoft SQL Server\90\Shared\sqlbrowser.exe