許多初學者在使用SQL Server時都會遇到使用SQL Server Management Studio無法連接遠程數據庫實例的問題,大致的錯誤描述如下:
An error has occurred while establishing a connection to the server.
(provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 5)
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 1326)
意思是說不能在數據庫之間建立一個連接,原因是命名管道提供者出現錯誤。其實這是一個比較典型的數據庫服務器設置問題,在局域網或廣域網中都可能會遇到,我們只需要對數據庫服務器進行一些配置便可以解決這個問題,來看看具體的步驟。
確保服務器端數據庫服務已經啟動
開始->所有程序->Microsoft SQL Server 2008->Configutation Tools,打開SQL Server Configuration Manager,點擊SQL Server Services,查看數據庫服務是否已經啟動,如果服務未開啟,手動啟動它。當然,你還可以通過點擊Windows中的開始->控制面板->管理者工具->服務,來查看相應的數據庫服務是否啟動。或者如果服務器和你的機器在同一網絡,你還可以通過命令“sqlcmd -L”(注意L要大寫)去查看該網絡內所有可用的SQL Server服務器。

it知識庫:解決SQL Server管理器無法連接遠程數據庫的問題,轉載需保留來源!
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。