2013-12-10 91 views
6

我已安裝Sql Express 2012版本。我分別安裝了本地Db。當我點擊「已安裝的Sql Server發現報告」時,我可以看到它的安裝。但是,我無法使用Sql Server Management Studio或Microsoft Visual Studio 2012專業版連接到它。我得到的錯誤:SQL Server Express 2012錯誤:無法連接到本地數據庫

"The attempt to attach to the database failed with the following 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: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details."

在Windows事件查看器我看到幾個每次都在與不同regsistry鍵的錯誤:

"The DataDirectory registry value is missing in the LocalDb instance registry key:{-----}" 

我regsitry值檢查本地數據庫中的HKEY_LOCAL_MACHINE \ SOFTWARE \微軟\ MicrosoftSQL Server本地數據庫,並且只有一個條目「已安裝的版本」。 我已經經歷了幾個職位,其中闡述了上述錯誤的解決方案,並已完成他們所提出的幾乎所有內容,但仍無法讓localDb工作。

爲了解決這個問題,我會很感激的。

UPDATE:

使用命令行界面我證實的LocalDB V11.0安裝。但是,命令sqlLocalDb info v11.0給出錯誤:「自動實例」v11.0「未創建,如果我嘗試創建一個,則會出現另一個錯誤:」在一個localDb實例API方法調用中出現意外錯誤。「

+0

您可以嘗試以下帖子:http://stackoverflow.com/a/31383366/1662459 –

回答

0

您可以嘗試使用SQL Server身份驗證另外,還要確保您的SQL服務正在運行

你也可以嘗試刪除以下注冊表:。

HKEY_USERS\.DEFAULT\Software\Microsoft\Microsoft SQL Server\UserInstances\[GUID_FROM_EVENT_LOG] 

您還可以檢查Getting Started with SQL Server 2012 Express LocalDB

+0

1.我得到了與SQL Server身份驗證相同的錯誤。 – AM0

+0

是的,SQL Server正在運行。 – AM0

+0

HKEY_USERS \ .DEFAULT \ Software \ Microsoft中沒有Microsoft SQL Server的條目。我也可以在那裏看到Sql Server Management Studio。 – AM0

0

您需要爲本地系統啓動sql服務。 1)開始按鈕 2)編寫「Sql Server配置管理器」並點擊它 3)打開「Sql Server配置管理器」後,您需要啓動本地系統服務,可能會停止它,爲什麼你的本地數據庫未連接。

啓動本地服務後,您只需連接本地系統數據庫即可。應該連接成功。

相關問題