2015-07-31 25 views
11
TITLE: Connect to Server 
------------------------------ 

Cannot connect to Thejus-PC. 

------------------------------ ADDITIONAL 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: 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%20SQL%20Server&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, Action`1 wrapCloseInAction) at 
> System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject 
> stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at 
> System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, 
> SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, 
> Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean 
> integratedSecurity, Boolean withFailover, SqlAuthenticationMethod 
> authType) at 
> System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo 
> serverInfo, String newPassword, SecureString newSecurePassword, 
> Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean 
> withFailover) at 
> System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo 
> serverInfo, String newPassword, SecureString newSecurePassword, 
> Boolean redirectedUserInstance, SqlConnectionString connectionOptions, 
> SqlCredential credential, TimeoutTimer timeout) at 
> System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer 
> timeout, SqlConnectionString connectionOptions, SqlCredential 
> credential, String newPassword, SecureString newSecurePassword, 
> Boolean redirectedUserInstance) at 
> System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity 
> identity, SqlConnectionString connectionOptions, SqlCredential 
> credential, Object providerInfo, String newPassword, SecureString 
> newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString 
> userConnectionOptions, SessionData reconnectSessionData, 
> DbConnectionPool pool, String accessToken) at 
> System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions 
> options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, 
> DbConnectionPool pool, DbConnection owningConnection, 
> DbConnectionOptions userOptions) at 
> System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection 
> owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions 
> userOptions) at 
> System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection 
> owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions 
> userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& 
> connection) at 
> System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection 
> outerConnection, DbConnectionFactory connectionFactory, 
> TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at 
> System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection 
> outerConnection, DbConnectionFactory connectionFactory, 
> TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at 
> System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 
> retry) at 
> System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 
> retry) 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() 
> 
> =================================== 
> 
> The system cannot find the file specified 
+0

Máy chủ SQL có được bắt đầu thành công không? Vâng, Windows 10 là rất mới (chỉ vài ngày kể từ khi phát hành chính thức), nhiều điều thú vị có thể xảy ra. – Raptor

+1

Nó cũng có thể quan trọng để biết những gì * phiên bản * và * phiên bản * của SQL Server bạn đang sử dụng. Một số phiên bản cũ hơn có thể không được hỗ trợ chính thức trên Windows 10. –

+0

Giải pháp của nó. Thực tế là dịch vụ máy chủ không khởi động ngay cả khi khởi động Loại là automatic.I bắt đầu thủ công và hoạt động hoàn hảo ngay bây giờ. – thejustv

Trả lời

8

Vui lòng xác minh rằng dịch vụ "SQL Server (MSSQLSERVER)" được bắt đầu.

Tôi đã bắt đầu dịch vụ "SQL Server (MSSQLSERVER)" và bây giờ tôi có thể truy cập vào máy chủ Sql.

+0

Nếu đây là câu trả lời cho vấn đề của bạn, thì đánh dấu câu trả lời này là "trả lời" để người dùng trong tương lai biết điều này đã giải quyết được vấn đề. –

+3

Đây là câu trả lời đúng, nhưng sau khi nâng cấp dịch vụ máy chủ SQL cần khởi động thủ công sau mỗi lần khởi động lại. Nếu bất cứ ai biết về một sửa chữa thích hợp cho điều này thì xin vui lòng bình luận hoặc trả lời. –

+0

cố gắng thay đổi loại khởi động thành thủ công và thử một. Tôi đã thay đổi thành thủ công và giờ nó tự động bắt đầu khi chúng tôi mở SSMS – thejustv

5

Vui lòng xác minh rằng Dịch vụ "SQL Server (MSSQLSERVER)" được bắt đầu. Bây giờ tôi đã nâng cấp lên Windows 10 và gặp vấn đề tương tự.

Tôi đã bắt đầu dịch vụ "SQL Server (MSSQLSERVER)" và bây giờ tôi có thể truy cập vào máy chủ Sql.

0

Hãy thử thay đổi chuỗi kết nối của bạn thành IP/NameInstance, nó hoạt động cho tôi. Trước khi tôi sử dụng để có localhost/NameInstance trong chuỗi kết nối của tôi nhưng kể từ khi tôi cập nhật lên cửa sổ 10, nó đã không hoạt động nữa.

1

Chúng tôi đã gặp sự cố này với Windows 7 và Windows 8. Sau khi nâng cấp SQL Server không khởi động. Chúng tôi đã có thể bắt đầu nó theo cách thủ công, nhưng nó sẽ không tự động bắt đầu.

Cho đến nay giải pháp duy nhất của chúng tôi là gỡ cài đặt và cài đặt lại SQL Server.

Các vấn đề liên quan