简体   繁体   English

无法连接到工作组网络上的SQL Server 2008

[英]Cannot connect to SQL Server 2008 on workgroup network

Two Windows 7 computers connected through network (workgroup) and can ping each other. 两台Windows 7计算机通过网络(工作组)连接,可以互相ping通。 I have my database on one of them and need the other computer to connect to this database through my window application. 我有一个数据库,需要另一台计算机通过我的窗口应用程序连接到这个数据库。

Here's what I have : 这就是我所拥有的:

  • both pcs are Windows 7 (ultimate & professional). 这两款电脑都是Windows 7(终极和专业)。
  • I enabled TCP/IP under SQL Configuration Tools. 我在SQL配置工具下启用了TCP / IP。
  • I enabled the Browser service. 我启用了浏览器服务。
  • I configured the connection string correctly. 我正确配置了连接字符串。
  • I tried connecting by ip address. 我尝试通过IP地址连接。
  • I created a rule in my Windows Firewall to allow incoming connection yo SQL Server with its default port. 我在Windows防火墙中创建了一条规则,允许SQL Server与其默认端口进行传入连接。
  • I don't have another Firewall. 我没有另一个防火墙。
  • I allowed external connection from SQL Server Management Studio. 我允许从SQL Server Management Studio进行外部连接。

Despite all this, I am still not able to connect to SQL Server on the other computer. 尽管如此,我仍然无法在另一台计算机上连接到SQL Server。

Can anybody help please? 有人可以帮忙吗?

It turned out to be a Firewall problem. 结果证明是防火墙问题。 I disabled Firewall and it worked. 我禁用了防火墙,它工作正常。 Even though I have the port opened as a rule, but there is something else in my Firewall which seem to be blocking the connection. 即使我通常打开端口,但我的防火墙中还有其他东西似乎阻止了连接。

I ended up disabling Windows Firewall and installing another one. 我最终禁用了Windows防火墙并安装了另一个。

If you are on a work group with a PC named SERVER and another PC named CLIENT, you have to choose what security you are going to use. 如果您所在的工作组中有一台名为SERVER的PC和另一台名为CL​​IENT的PC,则必须选择要使用的安全性。 STANDARD vs NT AUTHENTICATION. 标准与新生儿认证。

First, did you check to see if the server is active on the default port? 首先,您是否检查了默认端口上的服务器是否处于活动状态?

Did you try the following commands on the server from a command shell. 您是否从命令shell在服务器上尝试以下命令?

cd c:\temp
netstat -a -n -o > netstat.txt

Search for port 1433, is it open and listening? 搜索1433端口,是否可以打开并收听?

Second, did you make sure that TCP/IP is enabled for both the server and native client. 其次,您是否确保为服务器和本机客户端启用了TCP / IP。 Disable named pipes. 禁用命名管道。 Make sure shared memory is enabled. 确保已启用共享内存。

在此输入图像描述

I assume you can connect to the engine logged onto the SERVER via SSMS. 我假设您可以通过SSMS连接到登录到SERVER的引擎。 Correct? 正确?

Well, for what its worth, MS has an article on how to configure the ports for SQL server. 嗯,为了它的价值,MS有一篇关于如何为SQL服务器配置端口的文章。 It assumes you are using the defaults. 它假定您使用默认值。 For the default instance its 1433, but for a named instance, I do this from the command line: 对于默认实例1433,但对于命名实例,我从命令行执行此操作:

tasklist /svc | find "sql"

whatever the PID is for my named instance, plug it into netstat here 无论PID是否为我的命名实例,请在此处将其插入netstat

netstat -ano | find "PID HERE"

generally sql server will be listening on 0.0.0.0 which implies ALL adapters/addresses are listening on that port for SQL server. 通常sql server将监听0.0.0.0,这意味着所有适配器/地址都在侦听SQL Server的端口。 Whatever the port is on that record, that is what needs to be unblocked in the firewall. 无论该记录上的端口是什么,都需要在防火墙中解除阻塞。

here are the instructions from Microsoft which can be used as-is for a default instance, or modified to suit a named instance. 以下是Microsoft的说明,可以按原样用于默认实例,也可以修改为适合命名实例。 http://support.microsoft.com/kb/968872 http://support.microsoft.com/kb/968872

检查TCP / IP:SQL SERVER配置管理器> SQL Server网络配置>协议的协议>单击> TCP / IP>双击TCP / IP> IPAddress>全部启用“是”>“应用”>“确定”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM