SQL SERVER – Fix : Error : Login failed for user ‘UserName’. The user is not associated with a trusted SQL Server connection

Recently I have got two desktop computers at home and both of them are very powerful machine.

Machine 1 : Windows Vista SP1 with SQL Server 2008
Machine 2 : Windows 2003 with SQL Server 2005 with SP2

When I was trying to connect from SQL Server 2008 to SQL Server 2005 using Windows Authentication I was getting following error.

Login failed for user ‘UserName’. The user is not associated with a trusted SQL Server connection.

To resolve this error follow the steps below on computer with SQL Server 2005.

  • Create new user with Administrator privilege with same username and password as of SQL Server 2008 in operating system.
  • On SQL Server database create new user by expanding DatabaseNode >> Security >> Login >> Create New User and add this new user with Windows Authentication radio button selected. This user can be only added by selected Windows Authentication it is Operating system’s User Login.

Once above two steps are completed when connected from SQL Server 2008 to SQL Server 2005 using Windows Authentication it will connect successfully.

Reference : Pinal Dave (http://www.SQLAuthority.com)

About these ads

11 thoughts on “SQL SERVER – Fix : Error : Login failed for user ‘UserName’. The user is not associated with a trusted SQL Server connection

  1. hello
    i want connect to sql server 2000 sp3 with a windows ce device.

    can you help me about how connect to sql server with wireless network.

    and I connect to sql server with

    SqlConnection SqlCon = new SqlConnection(“Data Source=dell,1433;Initial Catalog=northwind;User ID=sa;Password=123;”);

    but show this error : 17
    sqlException

    thank.

    Like

  2. Whenever i try to connect to server i get sql server error 18452 then 18456

    I created new login from security general page and
    enabled it.But the default password is not going.
    Then i went to query window.ALTER LOGIN sa ENABLE
    GO
    ALTER LOGIN Sa WITH PASSWORD=” i did
    It is giving error 18452 this time.

    Like

  3. try to connect to server i get sql server error 18452 then 18456

    I created new login from security general page and
    enabled it.But the default password is not going.
    Then i went to query window.I wrote ALTER LOGIN sa ENABLE
    GO
    ALTER LOGIN Sa WITH PASSWORD=’
    It is giving error 18452 this time.

    Like

  4. Please check the Authentication mode of SQL Server.

    If it is in Windows, please change it to MIXED mode and try to connect using with the SQL Server Login.

    Like

  5. It works!
    As my testenvironment is similar like your example and I do not have a Windows domain I was searching what needs to be done, to use Windows authentication.
    Your steps worked perfectly.
    Thank you Pinal.

    Regards
    Thorsten

    Like

  6. hello my friend…………
    i create new login with SQL Server Authentication , but when i want connect to server with this new login , it has error:
    “cannot connect to ‘servername’ “……”login failed for user ‘username’ ” (microsoft sql server , error : 18456)
    i enter correct username and password.

    help me :(………………..

    Like

  7. Pingback: SQL SERVER – Beginning New Weekly Series – Memory Lane – #001 « SQL Server Journey with SQL Authority

  8. The 10-14 inch collars are most commonly used with dogs
    like Jack Russell Terriers, Shelties etc.
    This gps system functions just like the ones in your car and this way, it helps to maintain
    a safe hold over your pet. Once in place, tthe chip can be
    detected using a handheld scanner that then displays the unique code.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s