命名管道提供商,错误:40

时间:2015-03-06 21:34:11

标签: sql-server

我有一个sql server,我可以用ip 192.168.2.18的sa登录连接它 当我尝试从外部连接我的sqlserver时,我写了我的互联网IP并将1433端口转发到192.168.2.18。 我可以只使用本地ip连接我的sql server而无需编写任何服务器名称或实例名称。 我尝试通过ip only或ip \ instance或ip \ server \ instance连接到外部,但在任何情况下我都无法登录。

当我尝试使用ip登录时,我收到此错误

 ------------------------------
    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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476

当我尝试登录ip \ instance或ip \ server \ instance时出现此错误

------------------------------
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)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476

哪里错了?

  • 已启用命名管道/ TCP。
  • 实例中允许远程连接
  • Windows防火墙已关闭
  • Sql端口从路由器转发到服务器

我在localhost中连接到sql;服务器名称:SAMSUNG登录:sa密码:*****这完美无缺

我在同一个域中连接到sql;服务器名称:192.168.2.18登录:sa密码:******这完美无缺

所以我尝试将我的sql从互联网上连接起来;服务器名称:144.122.180.147登录:sa密码:******这不起作用。你能说我的服务器名称是对的还是需要更改它?

1 个答案:

答案 0 :(得分:0)

This link列出了可能会返回这些结果的问题。

通常,您的实例上未启用Named Pipes