none
Microsoft SQL Server, Error: 18456

    Question

  • ===================================

    Cannot connect to TECHY.

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

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

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

    ------------------------------
    Server Name: TECHY
    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, 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()
    Sunday, October 20, 2013 10:28 AM

Answers

All replies

  • SQL Server Error Log would have more details to the login failure.

    Also try connecting to the instance using SSMS through SA login




    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @PradeepAdiga

    Sunday, October 20, 2013 11:41 AM
  • Hello Vijay,

    Are you sure you have selected mixed mode authentication at the time of installation . Make sure mixed mode authentication is enabled in your instance.

    state 1 for the error 18456 always comes in SSMS or other tools , but the error logs will have the correct state number for this login failed error.

    Please open the errorlog file and post the actual error message here. You can make use of the below reference to troubleshoot the issue

    http://sql-articles.com/articles/troubleshooting/troubleshooting-login-failed-error-18456

    Thanks

    Please click the Mark as answer button and vote as helpful if this reply solves your problem


    Sunday, October 20, 2013 11:41 AM
  • Yes I have selected mixed mode authentication at the time of installation

    1] connecting through only :-

    server type:Database Engine
    server name:TECHY\SQLEXPRESS
    authentication:windows

    2] But Not connecting through :

    server type:Database Engine
    server name:TECHY  or TECHY\SQLEXPRESS
    authentication:sql server
    username:sa
    password: sasasasa

    how to copy error log ?


    vijay s. gachande


    Sunday, October 20, 2013 12:30 PM
  • Please refer the following articles on how to read the SQL Server Error Log

    View the SQL Server Error Log

    http://technet.microsoft.com/en-us/library/ms187109.aspx

    Reading the SQL Server log files using TSQL

    http://www.mssqltips.com/sqlservertip/1476/reading-the-sql-server-log-files-using-tsql/




    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @PradeepAdiga

    Sunday, October 20, 2013 4:38 PM
  • Hi Vijay,

    You can find error log file in under Log folder in your installation directory for ex:F:\MSSQL10.MSSQLSERVER\MSSQL\Log.

    You can find the location in the startup parameter in your SQL Server Configuration manager

    Since you were able to login to the instance, you can manually navigate through SQL Server Agent and get the error log if you have permissions.

    I am posting a sample error message for you. you can find something similar in your error log.Please copy and post the complete error message with state for error 18456.

    Error: 18456, Severity: 14, State: 8.
      Login failed for user 'sa'. Reason: Password did not match that for the login provided. [CLIENT: <local machine>]

    Thanks

    Please click the Mark as answer button and vote as helpful if this reply solves your problem

    Sunday, October 20, 2013 4:55 PM
  • I got support on this issue, but it was with the RC version.  I installed the full RTM version and the error has returned.

    What is the solution?

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

    Cannot connect to xxxxxxxxx.

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

    Attempted to read or write protected memory. This is often an indication that other memory is corrupt. (System.Data)

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

       at SNINativeMethodWrapper.SNIClose(IntPtr pConn)
       at System.Data.SqlClient.SNIHandle.ReleaseHandle()
       at System.Runtime.InteropServices.SafeHandle.InternalDispose()
       at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
       at System.Runtime.InteropServices.SafeHandle.Dispose()
       at System.Data.SqlClient.TdsParserStateObject.Dispose()
       at System.Data.SqlClient.TdsParser.Disconnect()
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginFailure()
       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)
       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()

    Friday, October 25, 2013 8:39 PM