SQL Server 连接常见错误

来源:互联网 发布:免费bpm软件 编辑:程序博客网 时间:2024/03/29 14:38

1.

在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)

在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)

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) (.Net SqlClient Data Provider)

这些问题可能是(从上至下检查):

原因验证解决物理服务器本身无法连通(比如防火墙阻止端口,默认是1433)ping servername
ping ip 
telnet ip 1433确保 servername或  ip 正确 
确保防火墙允许通过端口(默认是1433)指定的实例不存在(如拼写错误)--实例数据库服务没有启动(人类有时候就这么弱智)
-
Start > All Programs> Microsoft SQL Server2005 > Configuration Tools > SQL Server Configuration Manager > SQL Server 2005 Service > 启动对应的SQL Server实例
未启用远程连接-
如果不是本机连接,或者本机用IP连接,那么需要启动远程连接:
Start > All Programs > Microsoft SQL Server2005 > Configuration Tools > SQL Server Surface Area Configuration > SQL Server 2005 SQL Server Surface Area Configuration > <<instance>> > Database Engine > Remote Connections > Local and Remote connections > 选择 TCP/IP 或者 TCP/IP and Name Pipes
 
未启动 SQL Server Browser 服务-如果是远程连接,并且连接的不是默认实例,而是指定实例,那么需要启动 SQL Server Browser 服务 
Start > All Programs> Microsoft SQL Server2005 > Configuration Tools > SQL Server Configuration Manager > SQL Server 2005 Service > 启动 SQL Server Browser关于 Sql Server Browser 服务

 


原创粉丝点击