Login failed for user 'sa'. User not associated with a trusted SQL Server Connection.
Hi,
I am trying to login to SQL Server 2005 using SQL Server authentication using 'sa' account but it gives the below error
'Login failed for user 'sa'. Not associated with trusted SQL Server Connection'
The authentication mode set for the server was 'Windows Authentication' so i tried to change that to SQL Server and Windows Authentication but it didnt allow me to change the mode. It gives the below mentioned error.
"An exception occured while executing the Transact SQL or Batch Statement.
Execute permission denied on Object 'xp_instance_regwrite' , database 'mssqlsystemresource',schema 'sys' "
Could you anyone kindly let me how to resolve this issue so that i can connect to the SQL Server using sa account.
Thanks.
Answers
Login as Local Administrator to your machine (SQL Server instance machine) and login to SQL Server instance using windows authentication.
(a) Then change the Authenticaiton mode to SQL Server and WIndows (mixed mode)
(b) Enable SA Login
(c) Restart the service
Madhu
Hopefully you still have a sysadmin account to access the server either through the local administrator account as Madhu suggested or one you have set up. Change the authentication as advised.
There is a chance that the sa account is disabled (it is by default) so you may also need to enable this (right click the sa login, status, check enabled).
HTH!
All Replies
Login as Local Administrator to your machine (SQL Server instance machine) and login to SQL Server instance using windows authentication.
(a) Then change the Authenticaiton mode to SQL Server and WIndows (mixed mode)
(b) Enable SA Login
(c) Restart the service
Madhu
Hopefully you still have a sysadmin account to access the server either through the local administrator account as Madhu suggested or one you have set up. Change the authentication as advised.
There is a chance that the sa account is disabled (it is by default) so you may also need to enable this (right click the sa login, status, check enabled).
HTH!
Hello,
what do you mean by "enable sa login"? How do I enable a login?
Thanks.
- You can enable sa login using the below query. Execute it in SSMS,
Code SnippetAlter login sa enable
- Deepak well I tried to change security mode to "Mixed" and tried to enabled my user's login but I still get the following error:
Code Snippetjava.sql.SQLException: Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection.
I will add that I'm using JDBC to access SQL Server 2005 Express. I also enabled the TCP protocol in the network configuration. Can someone help?
Thanks.
- After changing the Authentication mode did you restart the Sql Service ?
- Deepak
yes I did. I still got the same error- Thank you, Madhu, This worked for me.
- Thank you, Madhu, It really helped me out. thanks alot :)
- haii ahve also same problemjava.sql.SQLException: Login failed for user 'ccms'. what can i doplease hel to me i have tried all the ways mixed authentication and restart sql server and all but i didt get connectionthe error like"java.sql.SQLException: Login failed for user 'ccms'."


