简体   繁体   English

SQL错误26错误定位指定的服务器/实例

[英]SQL Error 26 Error Locating Server/Instance Specified

I'm trying to find out this problem the whole day. 我试图整天找出这个问题。 I get an error on a website I'm trying to publish : 我在尝试发布的网站上收到错误消息:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. 建立与SQL Server的连接时发生与网络相关或特定于实例的错误。 The server was not found or was not accessible. 服务器未找到或无法访问。 Verify that the instance name is correct and that SQL Server is configured to allow remote connections. 验证实例名称正确,并且已将SQL Server配置为允许远程连接。 (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (提供者:SQL网络接口,错误:26-指定服务器/实例时出错)

I have done everything that other threads have said. 我已经完成了其他线程所说的一切。 Like open firewall ports (To make my life easy i just disabled it) Set up TCP/IP in SQL Server Configuration Manager, also done that set it to 1433. Yet there is something weird there just to say maybe that is it but im not sure on each IP it says Enabled: No 就像打开防火墙端口一样(为使生活变得轻松,我只是禁用了它)在SQL Server配置管理器中设置TCP / IP,也将其设置为1433。但是,有些奇怪的说法是,也许是这样,但不是确保在每个IP上显示“已启用”:否

Just thought that was weird but yea. 只是认为那很奇怪,但是。 And yes restarted SQL server service like 20 times now. 是的,现在像20次一样重新启动了SQL Server服务。 My instance name is SQLSERVER2016 I don't know if that was a smart idea. 我的实例名称是SQLSERVER2016我不知道这是否是一个聪明的主意。

I think it's the connection string since in SSMS I can connect to the instance without a problem but I'm not sure I'm still very new to SQL. 我认为这是连接字符串,因为在SSMS中我可以毫无问题地连接到实例,但是我不确定我对SQL还是很陌生。 I've set everything to connect with the Administrator account. 我已将所有内容设置为与管理员帐户关联。 So here are my connection strings. 这是我的连接字符串。

<add name="DefaultConnection" 
     connectionString="Data Source=KEVIN-WEBSERVER\SQLSERVER2016;Initial Catalog=BetaUsersDatabase;Trusted_Connection=yes;MultipleActiveResultSets=true;" 
     providerName="System.Data.SqlClient" />
<add name="ForumDatabase" 
     connectionString="Data Source=KEVIN-WEBSERVER\SQLSERVER2016;Initial Catalog=BetaForumDatabase;Trusted_Connection=yes;MultipleActiveResultSets=true;" 
     providerName="System.Data.SqlClient" />

I've also tried some other variations but they all did not work I have not kept them sorry. 我还尝试了其他一些变体,但是它们都没有起作用,我也没有让他们感到抱歉。 But yes, I'm using SQL Server 2016 Express. 但是,是的,我正在使用SQL Server 2016 Express。

You have a named instance , KEVIN-WEBSERVER\\SQLSERVER2016, and the named instance by default is listening on some dynamic port, that of course is not 1433. 您有一个命名实例 KEVIN-WEBSERVER \\ SQLSERVER2016,默认情况下,该命名实例正在某个动态端口上侦听,当然不是1433。

In order to connect to a named instance you should provide IP,port or you can use SQL Server Browser and pass in your instance name. 为了连接到命名实例,您应该提供IP端口,也可以使用SQL Server Browser并传入实例名称。

Your connection string does the latter, ie you pass in only the instance name, so your SQL Server Browser must be started. 您的连接字符串将执行后者,即您仅传入实例名称,因此必须启动SQL Server浏览器。

Here Overview of the SQL Server Browser service you find more about SQL Server Browser 在这里可以找到有关SQL Server Browser的更多信息,SQL Server Browser服务概述。

暂无
暂无

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

相关问题 SQL服务器错误(提供程序:SQL网络接口,错误:26-错误指定服务器/实例的位置) - SQL SERVER ERROR (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) SQL网络接口,错误:26-错误定位服务器/实例指定不使用SQL Server Express - SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified not using SQL Server Express ASP.Net错误26错误定位指定的服务器/实例 - ASP.Net Error 26 Error Locating Server/Instance Specified 错误26的解决方案-指定错误的服务器/实例定位? - Solution for Error 26 - Error Locating Server/Instance Specified? dotnetscorm-error:26-指定服务器/实例时出错 - dotnetscorm-error: 26 - Error Locating Server/Instance Specified 错误。 SQL网络接口,错误:26-指定服务器/实例时出错 - Error. SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified 仅在调试时才出现SQL Server错误26(指定错误的服务器/实例) - SQL Server Error 26 (Error Locating Server/Instance Specified) Only When Debugging 在我的VM上:SQL网络接口,错误:26-查找指定的服务器/实例时出错 - on my VM: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified 提供程序:SQL网络接口,错误:26-指定服务器/实例时出错 - provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified SQL网络接口,错误:26 - 找到为MDF文件指定的服务器/实例时出错 - SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified for MDF file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM