none
Error 18452 (not associated with a trusted sql server connection)

    Question

  • Using sql2005 on a Novell network...

    When attempting to log into Mgt Studio using windows authentication I am getting the error: Error 18452 (not associated with a trusted sql server connection) .

    I added my domain\userName in sql with no problems and added the account to the sysadmin server role.  However, I noticed my credentials on my pc are not listed as domain\userName but rather ComputerName\UserName.  I think this is what is causing the problem but I am not sure.  Can anyone lend a hand?

    I'd appreciate any help,

    Thanks.

    Scott

    Wednesday, May 3, 2006 9:17 PM

Answers

  • I think Laurentiu is right, I have found an article from IBM website:

    "....Solution
    To resolve this issue, follow the instructions to set User Authentication.
    SQL Server 2000:

    Go to Start > Programs > Microsoft SQL Server > Enterprise Manager
    Right-click the Server name, select Properties > Security
    Under Authentication, select SQL Server and Windows
    The server must be stopped and re-started before this will take effect


    SQL Server 2005:

    Go to Start > Programs > Microsoft SQL Server 2005 > SQL Server Management Studio
    Right-click the Server name, select Properties > Security
    Under Server Authentication, select SQL Server and Windows Authentication Mode
    The server must be stopped and re-started before this will take effect..."

    http://www-1.ibm.com/support/docview.wss?uid=swg21119906

    It has solved my problem, so I hope it could be helpful for you too.

    Tuesday, February 6, 2007 8:58 PM
  • Can you please post the exact error message from the SQL Server errorlog including the number and state of the error?

    Also, to get additional information, please connect the SQL Server Profiler and monitor the Audit Login and Audit Login Failed events in the Security category. Check to see what are the credentials that appear for the login attempt.

    You'll probably not be able to login anyway if your credentials are different from the ones you specified in SQL Server, but I would expect to see a different error in that case.

    Thanks
    Laurentiu

    Wednesday, May 3, 2006 9:26 PM
    Moderator
  • I had the same message when trying to connect to a SQL 2005 instance through Windows authentication.

    The client was written is VB 2005 and used OLEDB client access (not the SQL native client!)

     

     Switching the server to both SQL and Windows authentication did not solve the problem.

     

    I checked different parameters for the connection string and, finally, found the next one that works:

     

    'Connection information to connect to the database server to retrieve data

    'This is connecting to SQL server through OLEDB

    Dim ConnectionString As String = ""

    ConnectionString = "Provider=SQLNCLI;"

    ConnectionString += "Server=YourServerName;Database=YourDatabaseName;"

    ConnectionString += "Integrated Security=SSPI;"

     

    Important to note that Integrated Security=True; does not work.

     

    Horia

    Tuesday, July 24, 2007 8:04 PM
  • Alexander, Welcome to MSDN Smile

    In Sql Server 2005 go to Management studio > In object explorer right click on the server name >> go to properties >> Click on the security tab >> Choose Sql Server and Windows Authentication mode and restart the Sql services.

    - Deepak
    Wednesday, March 5, 2008 1:14 AM

All replies

  • Can you please post the exact error message from the SQL Server errorlog including the number and state of the error?

    Also, to get additional information, please connect the SQL Server Profiler and monitor the Audit Login and Audit Login Failed events in the Security category. Check to see what are the credentials that appear for the login attempt.

    You'll probably not be able to login anyway if your credentials are different from the ones you specified in SQL Server, but I would expect to see a different error in that case.

    Thanks
    Laurentiu

    Wednesday, May 3, 2006 9:26 PM
    Moderator
  • Hi,

    switch on the login audits at SQL Server to see which user tries to logon to the server.


    HTH, Jens Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---

     

    Thursday, May 4, 2006 6:49 AM
    Moderator
  • Hi

     

    I am having similar issue.

    When using Management Studio, XP clients can connect using widows authentication but windows 2000 clients cannot connect using windows authentication.

    Both XP and win2000 can connect using SQL Server authentication.

    It replaces my domain name with the workstation number and tries to connect using workstation\user_id rather than domain_name\user_id.

    I ran a profiler and this is what I got:

    login failed fo ruser ' '. This user is not associated with a trusted SQL Server connection.

     

    Wednesday, September 6, 2006 8:15 AM
  • Are all your machines in the same domain or are they in  different domains?

    Thanks
    Laurentiu

    Wednesday, September 6, 2006 4:54 PM
    Moderator
  • Hi

     

    These are all part of the same domain....

     

    Thanks

    Thursday, September 7, 2006 12:24 AM
  • This is strange - it should work without any problems if the machines are in the same domain and you attempt to connect as a domain user. Are you only seeing this issue with SQL Server? Can you access shares that are exclusively ACLed to a domain user from these 2000 machines?

    Thanks
    Laurentiu

    Friday, September 8, 2006 9:19 PM
    Moderator
  • I am getting the same problem.

    MachineA:
    Windows XP Pro.
    SQL Server 2005, Standard Edition
    Machine on Domain XXX
    User XXX\User1 is added to Administrators group

    MachineB:
    Windows XP Pro.
    SQL Server 2005, Developer Edition
    Machine on Domain XXX
    User XXX\User1 is added to Adminitrators group

    User1 logs onto MachineA and uses SQL Managment Studio to connect to database engine on MachineA (Local SQL Server), everything works. Then tries to connect to database engine on MachineB everything works.

    User1 logs onto MachineB and uses SQL Managment Studio to connect to database engine on MachineB (local SQL Server), everything works. Then tries to connect to database engine on MachineA (remote SQL Server) fails with error:
    Login failed for user ''. The user is not associated with a trusted SQL Server connection. (Microsorft SQL Server, Error: 18452)

    I have run the SQL Server Surface Area Configuration on both machines and tried to configure them exactly the same.

    I have checked Name resolution on both machines, no issues found. I can connect to other resources (\\MachineA\C$ works from MachineB and \\MachineB\C$ works from MachineA).

    I am going to try to install the Developer edition on Machine A to see if there is a difference, but I somehow don't think that it will make a difference...

     

    Luis

    Friday, October 6, 2006 1:58 PM
  • The Edition shouldn't make any difference. I don't know a reason for this behavior. Please open a bug by filling a report on the Product Feedback site at http://connect.microsoft.com/Main/content/content.aspx?ContentID=2220 and we'll continue from there.

    Thanks
    Laurentiu

    Friday, October 6, 2006 7:12 PM
    Moderator
  • Hi...I developed a small application using delphi to run queries on a SQL Server machine. This application worked well on my PC and via the network when I set the database name and server name.

    However, as I tried to make this application work on another SQL Server Machine (which has the same database and I have modified the server name in the Install Express)...I get an error

    "...not associated  with trusted SQL connection"

    then goes on to reference my Database object in the data module of the application...

    I tried almost everything from hard-coding a username and password in the Database object in the application...to no avail.

    Thanks again.

     

    Blackwidow25

     

    Monday, October 23, 2006 7:38 AM
  • Have you checked if the other SQL Server machine is using mixed mode authentication?

    If it does, try troubleshooting the SQL authentication using Management Studio or sqlcmd.

    Thanks
    Laurentiu

    Wednesday, October 25, 2006 11:50 PM
    Moderator
  • I get the exact same problem running the command "sqlcmd -E -S <RealIPAddressOrFullyQualifiedHostnameOfLocalHost>" (eg:  "sqlcmd -E -S myhost.mydomain.com") on a clean machine where SQL Server 2005 Standard Edition has just been installed with mixed authentication and TCP/IP protocol enabled. The command however works if the local IP address 127.0.0.1, or the local hostname without the domain is being used. This command also works: "sqlcmd -E -S tcp:myhost". Any idea?

    Wednesday, November 8, 2006 10:17 PM
  • I think Laurentiu is right, I have found an article from IBM website:

    "....Solution
    To resolve this issue, follow the instructions to set User Authentication.
    SQL Server 2000:

    Go to Start > Programs > Microsoft SQL Server > Enterprise Manager
    Right-click the Server name, select Properties > Security
    Under Authentication, select SQL Server and Windows
    The server must be stopped and re-started before this will take effect


    SQL Server 2005:

    Go to Start > Programs > Microsoft SQL Server 2005 > SQL Server Management Studio
    Right-click the Server name, select Properties > Security
    Under Server Authentication, select SQL Server and Windows Authentication Mode
    The server must be stopped and re-started before this will take effect..."

    http://www-1.ibm.com/support/docview.wss?uid=swg21119906

    It has solved my problem, so I hope it could be helpful for you too.

    Tuesday, February 6, 2007 8:58 PM
  • I am also had these same problem and struggled for long period. Finally I got these forum and succeeded. Thank you very much.

    Regards,

    Jose

    Monday, March 5, 2007 9:24 AM
  • I had the same message when trying to connect to a SQL 2005 instance through Windows authentication.

    The client was written is VB 2005 and used OLEDB client access (not the SQL native client!)

     

     Switching the server to both SQL and Windows authentication did not solve the problem.

     

    I checked different parameters for the connection string and, finally, found the next one that works:

     

    'Connection information to connect to the database server to retrieve data

    'This is connecting to SQL server through OLEDB

    Dim ConnectionString As String = ""

    ConnectionString = "Provider=SQLNCLI;"

    ConnectionString += "Server=YourServerName;Database=YourDatabaseName;"

    ConnectionString += "Integrated Security=SSPI;"

     

    Important to note that Integrated Security=True; does not work.

     

    Horia

    Tuesday, July 24, 2007 8:04 PM
  • Hi All,

    I had the same problem while connecting to SQL 2000 SP4. The solution suggested by yeukwong999 works well. Would like to thank (a lot) yeukwong999 for his solution.

     

    "....Solution
    To resolve this issue, follow the instructions to set User Authentication.
    SQL Server 2000:

    Go to Start > Programs > Microsoft SQL Server > Enterprise Manager
    Right-click the Server name, select Properties > Security
    Under Authentication, select SQL Server and Windows
    The server must be stopped and re-started before this will take effect

     

    B.Rgds

    Sathia

     

    Tuesday, July 31, 2007 11:30 AM
  • I'm having this issue as well. I've read through this message and many others but have not been able to find a solution.

     

    We have a SQL server on our domain with the developers and myself connecting via a VPN.

    All of us can log into the domain as well as remote desktop to the SQL box and log in SQL there as well.

    We can log in remotely using SQL authentication.

    Myself and one other developer can log in using windows but the others can not. I am able to use windows authentication with the username being LAPTOPNAME\Username. My username and password match that of the domain.

    When the new developers try and access SQL they can via SQL authentication but not windows.

     

    We have tried connecting via Visual Studio and disabling their firewall but are not able to get a login.

    The error below was captured on the SQ Server.

    2007-07-31 12:53:41.86 Logon       Error: 18452, Severity: 14, State: 1.

    2007-07-31 12:53:41.86 Logon       Login failed for user ''. The user is not associated with a trusted SQL Server connection. [CLIENT: (internal IP address)]

     

     

    Does anyone know why this would be happening? I believe we have narrowed it down to the individual client PC but I don’t know what else to check. Thanks.

     

    Doug

     

    Tuesday, July 31, 2007 7:36 PM
  • Thread posted by yeukwong999 is Very helpful. Thank you.

     

    Friday, August 10, 2007 3:40 AM
  • yeukwong rules!!!!!!


    Exactly the kind of answer I was looking for.

    Thursday, August 16, 2007 11:00 PM
  • Thanks for this tip.... fixed my problem !! ... 

     

     

     

    Thursday, September 27, 2007 5:39 PM
  • Hello

     

    i have the same problem. i have a small Access 03 Application which should be get the Data from a SQL Server 2000, which works in the LAN fine. So now we want to use it on a laptop. The user connects with VPN.

     

    The User get the Error Message "Login failed for user "(null)"; not associated with a trusted sql server connection".

    The Settings of the Server is mixed mode quit now. If the same User with the same Login use the Application in the Lan, there is no problem, just over VPN.

     

    The same Application needs Data from a SQL Server 2005, this Severs works fine, through VPN too.

     

    So maybe some solutions?

     

    best regards

    Ronald

    Friday, September 28, 2007 11:10 AM
  • Where do I do this?  Please excuse the novicity of this question, I'm just starting to get into sql!

    Thursday, January 10, 2008 2:05 PM
  • I'm standalone

     

    Thursday, January 10, 2008 3:38 PM
  • its a simple error that  u didnt see while installing sql

    \well try this

     

    stop the sql server, then start the enteerprise manager, expand till ur database, right click and select properties,

    select the security tab, change the authentication to SQL Server and Windows,

     

    restart ur sql server

    hope this will work

    regards

    Wednesday, February 6, 2008 12:29 PM
  • BUT: I have the "Developer Edition" of SQL Server 2005, and there doesn't seem to be an "Enterprise Manager".

    Tuesday, March 4, 2008 10:25 PM
  • Alexander, Welcome to MSDN Smile

    In Sql Server 2005 go to Management studio > In object explorer right click on the server name >> go to properties >> Click on the security tab >> Choose Sql Server and Windows Authentication mode and restart the Sql services.

    - Deepak
    Wednesday, March 5, 2008 1:14 AM
  • Hey yeukwong999 ,

    Thank you very much!

    I had same kind of problem in SQL 2005, while applying your solution it has resolved my issue.

    This below is too good:

    "Go to Start > Programs > Microsoft SQL Server 2005 > SQL Server Management Studio
    Right-click the Server name, select Properties > Security
    Under Server Authentication, select SQL Server and Windows Authentication Mode"

    ~Neeraj

     

    Wednesday, March 26, 2008 5:18 AM
  • Dear all,
    I had same kind of this problem. I use SQL Server 2000 Enterprice Edition SP4, working on Windows Server 2003 Enterprive SP2.
    I made a Distributor anh Publisher on a server, now I push a merge replicattion to another server (with the same Windows and SQL server).
    But it is not success, SQL sent message: Login failed for user <Client Server Name>. Reason: Not associated with a trusted SQL Server connection.
    I had selected both SQL Server and Windows Authentication Mode, but it can't resolved the problem.
    Can you give me any idea?
    Thanks all!

    Duy Nguyen.
    Tuesday, May 20, 2008 6:19 AM
  • Include

    Trusted_Connection=no;

    in you connection string. It will work.

     

    HTH

    Tuesday, July 1, 2008 2:44 PM
  • Be aware - you may face this issue if your system has been renamed.  I'm not sure exactly what caused the issue - but I searched my entire registry for the old computer name and changed it to the new computer name.  Also - I ran this script on the SQL instance:

     

    Select @@Servername to see the oldservername

     

    Use Master

    go

    sp_dropserver oldservername

    go

    sp_addserver newservername, local

    go

     

    'Reboot the server

     

    Select @@servername to see the newservername

    Thursday, October 9, 2008 7:22 PM
  • This worked for me. Thank you!
    Threshing it out.
    Wednesday, January 28, 2009 6:36 PM
  • I'm having this problem with users on a different domain than the machine. However, I'm on the same domain as the users and can connect fine. Any ideas?
    Tuesday, September 1, 2009 1:31 PM
  • I found my own answer, or rather my support group did. When I went across domains, my users had to be set up to have permissions in the server's domain even though they had access on the SQL Server database.
    Tuesday, September 1, 2009 6:01 PM
  • I think Laurentiu is right, I have found an article from IBM website:

    "....Solution
    To resolve this issue, follow the instructions to set User Authentication.
    SQL Server 2000:

    Go to Start > Programs > Microsoft SQL Server > Enterprise Manager
    Right-click the Server name, select Properties > Security
    Under Authentication, select SQL Server and Windows
    The server must be stopped and re-started before this will take effect


    SQL Server 2005:

    Go to Start > Programs > Microsoft SQL Server 2005 > SQL Server Management Studio
    Right-click the Server name, select Properties > Security
    Under Server Authentication, select SQL Server and Windows Authentication Mode
    The server must be stopped and re-started before this will take effect..."

    http://www-1.ibm.com/support/docview.wss?uid=swg21119906

    It has solved my problem, so I hope it could be helpful for you too.


    Thanks a lot

    this is the best best solution yeukwang999
    Wednesday, December 9, 2009 2:04 PM
  • thanks alot... Issue has been resolved
    Wednesday, February 10, 2010 6:44 PM
  • thanks ... this worked for me...
    Monday, May 24, 2010 7:15 AM
  • Just enable the "named pipes" at Protocols for MSSQLSERVER then restart server.

     

     

    Goodluck!

    Tuesday, August 3, 2010 12:24 PM
  • Thank you buddy :-)

    This solved my issue.


    Smile a lot, it costs nothing
    Tuesday, August 3, 2010 12:57 PM
  • I am having the same error:

    Error: -2147217843 Desc: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. 

    I have a VB6 app running  on a SQL Server 2000 database using Windows Authentication. I am running the compiled app using a batch command and receiving this error. If I go into the Microsft Visual Basic and run in debug mode, there is no problem starting the application. My SQL Server already has always "SQL Server and Windows" selected. And the most interesting part is, this used to work but I am getting tickets from our users that this stopped working today.

    I am open to any advices. Thanks in advance.

     

    Friday, October 1, 2010 4:47 PM
  • I am having the same error:

    Error: -2147217843 Desc: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. 

    I have a VB6 app running  on a SQL Server 2000 database using Windows Authentication. I am running the compiled app using a batch command and receiving this error. If I go into the Microsft Visual Basic and run in debug mode, there is no problem starting the application. My SQL Server already has always "SQL Server and Windows" selected. And the most interesting part is, this used to work but I am getting tickets from our users that this stopped working today.

    I am open to any advices. Thanks in advance.

     

    Ok, I figured out that the app was trying to run from a different domain. Problem resolved.
    Saturday, October 2, 2010 8:56 AM
  • Thank you

     

    it is working

     

     

    Friday, October 29, 2010 6:38 AM
  • It was greate. Solved my problem and I think it is the right way precisly after installation.
    meka38
    Monday, November 22, 2010 4:09 PM
  • There is no "security" tab under properties.

    But what did work for me is this:  Open Management Studio, right click database engine(In registered servers),  choose "Update Local Server Registration" , and walllaaaaaa the sql instance appears with the new computer name..

    Wednesday, December 1, 2010 1:12 PM
  • Setting the owner for the database solved the problem for me :)
    Tuesday, January 11, 2011 9:18 AM
  • ur tha maaaaan..! it worked,.!!
    Sunday, October 23, 2011 9:56 PM
  • I think Laurentiu is right, I have found an article from IBM website:

    "....Solution
    To resolve this issue, follow the instructions to set User Authentication.
    SQL Server 2000:

    Go to Start > Programs > Microsoft SQL Server > Enterprise Manager
    Right-click the Server name, select Properties > Security
    Under Authentication, select SQL Server and Windows
    The server must be stopped and re-started before this will take effect


    SQL Server 2005:

    Go to Start > Programs > Microsoft SQL Server 2005 > SQL Server Management Studio
    Right-click the Server name, select Properties > Security
    Under Server Authentication, select SQL Server and Windows Authentication Mode
    The server must be stopped and re-started before this will take effect..."

    http://www-1.ibm.com/support/docview.wss?uid=swg21119906

    It has solved my problem, so I hope it could be helpful for you too.

    Man u r awesum u solved me a serious problem. thanks ;) njoi 

    • Proposed as answer by Kitilson Monday, July 16, 2012 10:53 PM
    Wednesday, March 28, 2012 9:12 AM
  • I had same problem on Sql Server 2000, and this solution works.
    Monday, July 16, 2012 10:57 PM
  • My Issue was that Front End Users from different Functional Units of the Company had logon failures:

    Solutions: I changed the authentication mode to mixed and restarted the server and it worked very well.

    Thanks to the suggestions made by all of you.

    armstrong

    Friday, April 11, 2014 2:04 PM