sql 网络接口错误 26 - 错误定位 server/instance 指定

sql network interfaces error 26 - error locating server/instance specified

好吧,很多人都发布了类似的问题,但是我似乎无法在其中任何一个中找到解决我的问题的方法。这就是我的情况。

昨天我通过 SQL Server Management Studio 使用我的 SQL Server Express。我关闭了我的项目,因为我之前已经做过多次,然后今天早上当我尝试再次连接该工具时出现了这个错误:

TITLE: Connect to Server

Cannot connect to .\SQLExpress.

ADDITIONAL INFORMATION:

A network-related or instance-specific error occurred while establishing a connection to 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. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

我想我的主要问题是这个问题是否有解决方案,或者我是否必须重新安装 SQL Server Express?

PS:这是一些系统统计数据。我正在 Windows 10 机器上工作,SQL Server Management Studio 版本是 2014。

  1. 打开SQL服务器配置管理器

  2. 点击SQL Server Network Configuration然后点击Protocols for Name

  3. 右键单击TCP/IP(确保已启用),单击Properties

  4. Select IP Addresses Tab 并转到最后一个条目:IP All

  5. 输入TCP Port 1433.

现在使用 services.msc (winKey + r)

重新启动 "SQL Server .Name."

我遇到了同样的问题,但解决方案不同。我的协议配置正确,但我仍然遇到问题。在 SQL 服务器配置管理器 中确保 SQL 服务器浏览器 配置为自动启动并且是 运行.服务一启用,我的问题就消失了。

在 IT 人员对 SQL 服务器进行一些安全设置几天后,这个问题也让我感到困惑。我有一个 EntityFramework 用于 Web 应用程序和一个桌面应用程序。在 SQL 服务器上做了一些设置后,Web 应用程序恢复正常,但桌面仍然有问题。但是我为这两个应用程序都使用了一些连接字符串,这是没有意义的,一个可以工作而另一个不能。然后我搜索了很多,直到我发现有人说需要在 $ServerName$DatabaseInstanceName,1433 之后添加一个端口号 1433 在这里 http://www.windows-tech.info/15/9f6dedc097727100.php . after i added it. the exception became: System.Data.SqlClient.SqlException: Login failed for user 'domain\name-PC$'. then i found this link System.Data.SqlClient.SqlException: Login failed for user : System.Data.SqlClient.SqlException: Login用户失败,它说需要添加 Trusted_Connection=False;。整个连接字符串应该是这样的:data source=XXXXX\SQLSERVER,1433;initial catalog=XXXDB;user id=UserID;password=PWD;Trusted_Connection=False;MultipleActiveResultSets=True;

希望这个答案能帮助那些解决一般异常的人:“错误:26-错误定位 Server/Instance 指定)