SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified

原文链接:https://blogs.msdn.microsoft.com/sql_protocols/2007/05/13/sql-network-interfaces-error-26-error-locating-serverinstance-specified/

 

Users often see this error message when connection to a SQL Server and don't know where to start to solve the problem. In most forums, people says this is because remote connection is not enabled on the server. This is not exactly correct. Actually, this error message give customers very specific information and the solution is quite simple.

First of all, you get this error message only if you are trying to connect to a SQL Server named instance. For default instance, you never see this. Why? Because even if we failed at this stage (i.e. error locating server/instance specified), we will continue to try connect using default values, e.g defaul TCP port 1433, default pipe name for Named Pipes. You may see other error message due to failure later, but not this error message.

Every time client makes a connection to SQL Server named instance, we will send a SSRP UDP packet to the server machine UDP port 1434. We need this step to know configuration information of the SQL instance, e.g., protocols enabled, TCP port, pipe name etc. Without these information, client does know how to connect the server and it fails with this specified error message. 

In a word, the reason that we get this error message is the client stack could not receive SSRP response UDP packet from SQL Browser. It's easy to isolate the issue. Here are the steps:
1) Make sure your server name is correct, e.g., no typo on the name. 
2) Make sure your instance name is correct and there is actually such an instance on your target machine. [Update: Some application converts \ to . If you are not sure about your application, please try both ServerInstance and Server\Instance in your connection string]
3) Make sure the server machine is reachable, e.g, DNS can be resolve correctly, you are able to ping the server (not always true). 
4) Make sure SQL Browser service is running on the server.
5) If firewall is enabled on the server, you need to put sqlbrowser.exe and/or UDP port 1434 into exception.

Once you are done the steps, you should not see this error message anymore. You may still fail to connect your SQL server, but error message should be different and you have a different issue now. [Update: If it still fails, you may replace serverinstance with tcp:serverinstance and/or np:serverinstance and see if it succeeds with either TCP or NP protocol. That way, you can isolate the issue a little bit. ]

There is one corner case where you may still fail after you checked step 1)-4). It happens when a) your server is a named instance on cluster or on a multi-homed machine, and b) your client is a Vista machine with Firewall on. I have explained the details at: Unable to connect to a SQL Server named instance on a cluster

[Update May 2009] My collegue found a good tool online which could be very helpful for users to isolate issues related to this error message. You can download PortQry from http://support.microsoft.com/kb/832919, run "portqry.exe -n yourservername -p UDP -e 1434". If this command returns information and it contains your target instance, then you can rule out possiblity 4) and 5) above, meaning you do have a SQL Browser running and your firewall does not block SQL Browser UDP packet. In this case, you can check other issue, e.g. wrong connection string.

 

As a final note, the error message for the same issue when you use SNAC is: 
[SQL Native Client]SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].

 

If you still see this error, please post questions at MSDN SQL Server Data Access Forum:
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=87&SiteID=1 
Please mention you already read this post and confirm steps you have taken and the results of each step.(e.g. serverinstance,etc)  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 这个错误提示是在尝试连接 SQL Server 数据库时出现的,可能是由于网络问题或者实例配置问题导致的。需要验证实例名称是否正确,并且 SQL Server 是否已经配置为允许远程连接。同时,还需要检查网络连接是否正常。错误信息中提到了一个 provider: sql network interfaces, error: 26 - 定位指定的服务器/实例时出错,这可能是由于连接字符串中指定的服务器或实例名称不正确导致的。 ### 回答2: “与网络相关的或特定于实例的错误”一般是指连接数据库时出现的错误。可能是由于网络问题、实例名称输入错误或 SQL Server 的设置问题导致连接失败。在面对这种情况时,最好分步骤进行排错。 首先,我们需要检查网络连接。确认本地网络连接是否正常,检查远程服务器是否开启并处于连接状态。如果网络没有问题,那么可以再次检查实例名称是否正确,尝试通过 IP 地址连接 SQL Server。 如果连接仍然失败,那么问题可能是由 SQL Server 的设置问题导致的。请检查是否启用了远程连接。可以在 SQL Server Configuration Manager 中找到“SQL Server Services”,选择要连接的实例,并在“TCP/IP”协议的属性中启用“远程连接”。 如果以上方法都没有解决问题,使用 SQL Server Management Studio 检查实例的端口号和配置文件中的信息是否匹配。还可以使用 SQL Server Profiler 来检测是否有连接请求到达服务端。 总之,在与 SQL Server 建立连接时出现网络相关或特定于实例的错误时,我们应该分步骤进行排错,从网络连接到实例名称、SQL Server 设置等方面逐一排查,找到根本原因并进行解决。 ### 回答3: 如果在与 SQL Server 建立连接时出现网络或特定于实例的错误,这通常表示服务器无法在网络上被找到或无法被访问。这个问题经常出现在以下情况下: 1. 实例名称不正确:检查实例名称是否正确拼写。有时候可能会发生笔误或者其他拼写错误导致实例名称不被识别。 2. SQL Server 配置不正确:确保 SQL Server 已经正确配置为允许远程连接和接受来自特定 IP 地址的连接。这可以在 SQL Server 的配置管理器界面中进行修改。 3. 防火墙堵塞连接:防火墙可能会阻止连接到 SQL Server,这通常由于网络安全策略导致。您需要根据使用的防火墙软件,进行相应的配置,允许 SQL Server 数据库的访问。 4. 实例不存在或已关闭:检查 SQL Server 是否启动。如果未启动或已关闭,您需要启动 SQL Server 服务并检查 SQL Server 日志以找出任何与该问题相关的详细信息。 5. SQL Server 配置错误:如果您对 SQL Server 不熟悉或不确定某些配置如何设置,您可以搜索SQL Server的相关帮助文档或咨询相关的技术支持。 总之,要解决与 SQL Server 建立连接时出现的网络或特定于实例的错误,您需要仔细检查配置并尝试进行简单的故障排除。拉一个专业的人员为您解决也是个不错的选择。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值