I am facing this problem when connecting to local system db, but when I connect any server it connects.

Login failed for user 'domain\username'. (Microsoft SQL Server, Error: 18456)

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

Solution by Pinal Dave:

  • 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.you should perform the above steps using windows authentication

Also see http://bjtechnews.wordpress.com/2012/03/20/microsoft-sql-server-error-18456-login-failed-for-user/

Scenario - I was connecting my local SQL server by using SQL authentication. I got an error code: 18456. After digging a bit i found the solution - SQL server error: 18456 overview - This error occurs when your authentication request is been successfully accepted by SQL server named, but due to some reason SQL server is not able to grant the access to connect.

Reason - This error reveals that SQL server authentication is not enabled in local server.

To enable SQL server authentication, Follow the below steps

Step 1 - Go to SQL server properties by Right click -> Properties.

Step 2 - Enable SQL server authentication mode.

Step 3 - Restart the SQL server.

I hope it will help, Check here for more detail

  • For SQL Server 2014: Right click -> Properties -> Security -> Server Authentication: select "SQL Server and Windows Authentication mode" – Josh Noe Oct 21 '14 at 18:39

I had this issue because I had granted a group access from the parent domain that was a "Domain Local" AD group (as opposed to a Global / Universal AD group). Domain Local groups can't be authenticated by child domains and that's what this error was very cryptically trying to tell me :-).

The following worked for us:

  • Right click on the SQL server database instance
  • Click on the Permissions

**Permissions**

  • Select the user in concern
  • Make sure that View Server State privilege is granted to the user

<code>View Server State privilege</code> is granted to the user

Alternatively, in case of lack of required permissions - ask the sys admin to execute the following code:

use master
go
GRANT VIEW SERVER STATE TO <user_name>

Use the below syntax in case of users in domain

use master
go
GRANT VIEW SERVER STATE TO [domain\user]

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.