2013-02-11 81 views
5

我有一个新安装的SQL Server 2008 R2 Express。我试图运行SQLCMD本地(请注意本地),但我收到的错误:Microsoft SQL Server Native Client 10.0登录超时过期

Named Pipes Provider: Could not open a connection to SQL Server [2]
Sqlcmd: Error: Microsoft SQL Serve Native Client 10.0 : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more informations see SQL Server Books Online..
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0: Login timeout expired.

为什么我不能使它工作吗?我已经尝试了一切。

+1

说你试过一切并不是那么有用。我们需要知道一些具体的东西:它是SQL Server的默认实例吗?你的连接字符串是什么样的?等等。你的主要问题是你没有在第一时间找到服务器...... – 2013-02-11 15:33:20

+0

服务器实例是SQLEXPRESS。我配置了TCPIP。我检查了服务正在运行。我启动了SQL BRowser。仍然SQLCMD不起作用。 – 2013-02-11 15:37:49

+0

连接字符串是什么样的? – 2013-02-11 15:40:13

回答

1

我曾尝试设置新的SQL Server服务器的客户端发生了同样的事情。

在SQL实际安装的机器上打开您的SQL Server配置管理器。

查看SQL Native Client 10.0配置。在那下是客户端协议。您可能有TCP/IP和命名管道禁用。你需要启用它们。

Sample here

+0

可悲的是它没有工作 – dialex 2013-10-31 11:43:19

4

也许有点晚在这里的平局,但对于这一问题未来的读者:尝试运行命令提示符以管理员身份。

+0

好的建议这应该更高。 – 2014-07-15 11:51:16

2

在命名管道的属性只是改变路径\\.\pipe\sql\query,而不是默认的路径

0

这似乎当无法找到服务器或实例太多的事情发生。

它最终将密切与原因(错误的第一部分可能是什么误导你):

Sqlcmd: Error: ... : Login timeout expired.

Sqlcmd: Error: ... : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections.

所以:

  • 检查服务器名称是否正确;
  • 检查实例名称是否正确(如果您不想使用默认实例,请尝试完全删除实例名称);
  • 检查服务器是否可以使用ping达到等
3

我遇到了同样的问题。我用-S代替-s,并在servername \ instance之前和之后删除了“”。之后一切都很顺利。

0

我有同样的问题,原因是因为没有服务器名时单独键入sqlcmd尝试连接到默认服务器。如果您已命名实例,则无法指定实例名称就无法连接到它。解决办法是通过更改此链接中显示的端口来将命名实例设置为默认实例: SQL Server, convert a named instance to default instance?

相关问题