Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A connection was successfully established with the server, but then an error occurred during the login process. (Error Number: 233)

I am having error while connecting to SQL Server:

enter image description here

Details in Stack Trace are:

===================================  Cannot connect to ServerName.  ===================================  A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (.Net SqlClient Data Provider)  ------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=233&LinkId=20476  ------------------------------ Server Name: ServerName Error Number: 233 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.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)    at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)    at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()    at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()    at System.Data.SqlClient.TdsParserStateObject.ReadByte()    at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)    at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)    at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject, Boolean withFailover)    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() 

NOTE I have tried

  • closing, reopening Sql server Management Studio.

  • closing , reopen VS & rebuild Solution

  • killed worker process accessing database.

  • login credentials are correct.

  • able to ping server to make sure its not down.

like image 558
Pranav Singh Avatar asked Dec 23 '15 07:12

Pranav Singh


People also ask

Can not connect to the SQL Server the original error is a connection was successfully established with the server but then an error occurred during the login process?

The reason for this common error is that by default MS SQL Server runs in “Windows Authentication mode”. And you will need to change it to “SQL Server and Windows Authentication mode” by following the steps below: Launch SQL Server Management Studio. Log into your SQL Server using Windows Authentication.


2 Answers

For SQL2008,

  • open Management Studio
  • Rt click on instance
  • go to properties
  • select Security
  • Under Server Authentication, check SQL Server and Windows Authentication Mode
  • hit OK

Restart the server using configuration manager.

like image 144
user7643068 Avatar answered Sep 22 '22 23:09

user7643068


Turn out to be some SQL service was stopped somehow on server. Restarting SQL Server service manually was the solution.

like image 44
Pranav Singh Avatar answered Sep 24 '22 23:09

Pranav Singh