2013-02-11 372 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?

相關問題