解决Sql Server 2005连接问题

时间:2022-02-24 13:23:53

I have a .Net 3.5 App using a SQL Server Express 2005 database that allows connections over TCP/IP. The computer that has the SQL Server installed is part of a domain. The program is installed on 3 computers and share the same database. The connection string is in a file that is shared among all the computers. SQL Server is installed on Windows Server 2003 machine. The other two computers are Windows XP. One of the XP machines is part of the domain and resides at the same location as the server. The other XP machine is not part of the domain and connects to the server using hardware VPN (always on ). The program on Windows Server and the XP machine that are part of the domain are able to open connection to the database, but the XP machine that connects via VPN is timing out when trying to open a connection. Server has Mixed-mode authentication. The authentication I am using is Sql server user-name and password.

我有一个.Net 3.5应用程序使用SQL Server Express 2005数据库,允许通过TCP / IP连接。安装了SQL Server的计算机是域的一部分。该程序安装在3台计算机上并共享同一个数据库。连接字符串位于所有计算机之间共享的文件中。 SQL Server安装在Windows Server 2003计算机上。另外两台计算机是Windows XP。其中一台XP机器是域的一部分,与服务器位于同一位置。另一台XP机器不是域的一部分,使用硬件VPN连接到服务器(始终打开)。作为域的一部分的Windows Server和XP机器上的程序能够打开与数据库的连接,但是在尝试打开连接时,通过VPN连接的XP机器会超时。服务器具有混合模式身份验证。我使用的身份验证是Sql server用户名和密码。

Here is the check list I used trying to figure out the issue:
1. The SQL Browser is running on the Windows Server machine. [Port: 1434]
2. The SQL Server is accepting connections over TCP (but not Named Pipes)
3. Server responds to Ping from the client.
4. Checked the ErrorLog of sql server and noted the port. I am able to telnet to the server ip and sql port from the command line on the client.

以下是我用来解决问题的检查列表:1。SQL浏览器在Windows Server计算机上运行。 [端口:1434] 2. SQL Server正在接受通过TCP的连接(但不是命名管道)3。服务器从客户端响应Ping。 4.检查sql server的ErrorLog并记下端口。我能够从客户端的命令行telnet到服务器IP和SQL端口。

How can I find where is connection is being timed-out? Is there is portable-program (no installation) that I can use on the server to check the network traffic and see if the request is being received or dropped in the middle?

如何找到连接超时的位置?是否有便携式程序(无安装),我可以在服务器上使用它来检查网络流量,看看请求是在中间接收还是丢弃?

Thanks,
Kishore. A

谢谢,基肖尔。一个

3 个解决方案

#1


You can use SysInternals TCPView to monitor traffic.

您可以使用SysInternals TCPView来监控流量。

#2


are you sure that you're not talking on 1433? i'd get on the client machine and try to telnet through port 1433 and 1434 and see if you can connect to the servers (obviously you won't be able to login, but you should be able to see if you can connect). at least that tells you whether you have a firewall issue of some sort or if you're connecting on the right port.

你确定你不是在说1433吗?我会上客户端机器并尝试telnet通过端口1433和1434,看看你是否可以连接到服务器(显然你将无法登录,但你应该能够看到你是否可以连接)。至少它告诉你是否有某种防火墙问题,或者你是否在正确的端口上连接。

-don

#3


There is no portable network sniffer that I am aware of as you need WinCAP to put the card into promiscuous mode. What you can do is install Wireshark on the XP machine to dump the network traffic and use management studio on the server to watch the connections.

我知道没有便携式网络嗅探器,因为你需要WinCAP才能将卡置于混杂模式。您可以做的是在XP机器上安装Wireshark以转储网络流量并使用服务器上的管理工作室来监视连接。

You could also use netstat on the server to view open ports and with knowledge of the VPN IP address this will also tell if a socket has been opened on the server.

您还可以在服务器上使用netstat来查看开放端口,并了解VPN IP地址,这也将告知服务器上是否已打开套接字。

eg: netstat -p tcp -b

This will generate output showing src/dest IP address and the application that is using that socket

这将生成显示src / dest IP地址和使用该套接字的应用程序的输出

TCP 192.168.1.1:1146 192.168.1.1:80 ESTABLISHED
[FIREFOX.EXE] 

#1


You can use SysInternals TCPView to monitor traffic.

您可以使用SysInternals TCPView来监控流量。

#2


are you sure that you're not talking on 1433? i'd get on the client machine and try to telnet through port 1433 and 1434 and see if you can connect to the servers (obviously you won't be able to login, but you should be able to see if you can connect). at least that tells you whether you have a firewall issue of some sort or if you're connecting on the right port.

你确定你不是在说1433吗?我会上客户端机器并尝试telnet通过端口1433和1434,看看你是否可以连接到服务器(显然你将无法登录,但你应该能够看到你是否可以连接)。至少它告诉你是否有某种防火墙问题,或者你是否在正确的端口上连接。

-don

#3


There is no portable network sniffer that I am aware of as you need WinCAP to put the card into promiscuous mode. What you can do is install Wireshark on the XP machine to dump the network traffic and use management studio on the server to watch the connections.

我知道没有便携式网络嗅探器,因为你需要WinCAP才能将卡置于混杂模式。您可以做的是在XP机器上安装Wireshark以转储网络流量并使用服务器上的管理工作室来监视连接。

You could also use netstat on the server to view open ports and with knowledge of the VPN IP address this will also tell if a socket has been opened on the server.

您还可以在服务器上使用netstat来查看开放端口,并了解VPN IP地址,这也将告知服务器上是否已打开套接字。

eg: netstat -p tcp -b

This will generate output showing src/dest IP address and the application that is using that socket

这将生成显示src / dest IP地址和使用该套接字的应用程序的输出

TCP 192.168.1.1:1146 192.168.1.1:80 ESTABLISHED
[FIREFOX.EXE]