2012-04-04 158 views
2

不知道是什麼原因造成的,我結束了任務管理器中某些SQL進程的任務,然後重新啓動了計算機。現在我不能再登錄到SQL Server 2008 R2。這是在嘗試登錄時,我得到的錯誤:無法再登錄到SQL Server 2008 R2

==================================

Cannot connect to JSMITH.

===================================

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)

------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476

------------------------------ Error Number: 2 Severity: 20 State: 0

------------------------------ Program Location:

at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server) at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

+0

您是否比較近期從以前的版本遷移到SQL Server 2008 R2?它是就地升級還是全新安裝? – 2012-04-04 03:06:47

回答

3

我會建議檢查以下內容:

  1. 檢查SQL Server服務正在運行,如果不檢查事件日誌的任何服務相關的錯誤。

  2. 檢查在配置管理器中是否啓用了名稱管道。您也可以嘗試切換爲使用TCP/IP。如果您切換到TCP/IP,則需要確保SQL Server Browser服務已啓用/正在運行。

+0

+1我會打賭,該服務沒有運行... – 2012-04-04 03:27:38

+0

SQLServer.exe運行在進程中,在服務SQLWriter,SQLSERVERAGENT,SQLBrowser,SQLAgent $ SqlExpress正在運行...我應該尋找哪個服務? – tweetypi 2012-04-04 03:41:45

1

嘗試重新啓動計算機。如果其他人對您的服務器擁有管理員權限,則可能他們可能更改了您的密碼。

+1

在這種情況下,會出現認證錯誤而不是連接錯誤。 – BluesRockAddict 2012-04-04 03:30:53

+0

認證錯誤看起來像'登錄失敗的用戶'用戶名'。 (Microsoft SQL Server,錯誤:18456)'。 – 2012-04-04 03:34:04

1

我在commandprompt執行這個解決了這個問題:

net start "SQL Server (MSSQLSERVER)"

林不知道爲什麼這個固定或者爲什麼服務沒有在Windows啓動時自動啓動,但。

0

運行Services.msc,轉到SQL Server代理,如果服務未運行,請啓動該服務。

關於服務: 執行作業,監視SQL Server,觸發警報,並允許自動執行一些管理任務。

相關問題