首页 > 解决方案 > SQL Server 已失去 tcp/ip 连接,在本地工作

问题描述

今天早上错误地停止了 VM 上的 SQL Server 安装。恢复后,它会在本地计算机上正常通信。它不再适用于 TCP/IP。尝试从不同机器上的 SSMS 与服务器通信会导致

A network-related or instance-specific error occured while establishing a 
connection to SQL Server.  The server was not found or is not accessible.  
Very that the instance name is correct and that the SQL Server is 
configured to allow remote connections. (provider:Named Pipes Provider,
error:40 - Could not open a connection to SQL Server)(Microsoft SQL Server, 
Error 1326)

    The user name or password is incorrect

用户名和密码在本地使用时可以正常工作。已在本地测试 Windows Auth,远程 sql 用户(我们没有域)

在 SQL Server 配置管理器 > Sql Server 网络配置 > MSSQLServer 的协议 > TCP/IP > IP 地址中,所有内容都显示正确配置。IPv6 IPv4 地址正确,并且 IPAll 具有正确的端口(默认 1433)

服务器可以 ping 网络上的多个主机。他们可以ping回来。它只是一个不可路由的子网。192.168.0.*

pc 的名称与 sql server 的名称匹配SELECT @@SERVERNAME

服务器版本为 10.50.6000,映射到 SQL Server 2008 R2

标签: sql-serversql-server-2008-r2

解决方案


首先在防火墙中允许 1433 端口(入站/出站规则)然后尝试使用 ServerName 登录:IPAddress\InstanceName,1433 身份验证:SQL Server 身份验证


推荐阅读