0

When I try to connect to the SQL Server running on localhost using Windows Authentication in SQL Server Management Studio, I am able to connect but when I try to connect using SQL authentication, it says Login failed even though I know the user with the password exist on the DB. Here is the error log -

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

            Cannot connect to localhost.

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

            Login failed for user 'admin'. (.Net SqlClient Data Provider)

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

            ------------------------------
            Server Name: localhost
            Error Number: 18456
            Severity: 14
            State: 1
            Line Number: 65536


            ------------------------------
            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.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)
               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.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ValidateConnection(UIConnectionInfo ci, IServerType server)
               at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()
Arunabh Das
  • 103
  • 1
  • 4

1 Answers1

1

Have you checked that the sql server is actually configured to accept SQL Authentication . (ie in Management Studio, right click on the server and select properties and then the security section).

sgmoore
  • 652
  • 5
  • 10