I am trying to localhost using windows authentication with SQL Server management studio and I am getting a message that "Login failed for user..." (Error 18456).

I made sure that all the services are started, and I enabled the named pipe, TCP/IP protocol and shared memory for both Network configuration and Native Client config.

I have never tried to connect to localhost before, but I installed the Adventureworks sample database fine, and that's what I am trying to get to.



Turns out that I had to go into the Surface Area Configuration and add myself as an Administrator. I am not really sure why this was the case, but it seems to have solved my problem. I could then connect using my computer name.

  • This worked for me too. Strangely, I was already a member of the local Windows 'Administrator' group and I was already able to connect remotely using SSMS. The two servers where I've observed this issue are both running Windows Server 2008. I've never observed this problem before with SQL Server 2005 on servers running Windows Server 2003. – Kenny Evitt Aug 18 '11 at 20:41
  • This took me hours to figure out, as someone who's not familiar with SQL Server databases. MS could've done a better job documenting this for beginners. – Martijn Heemels Nov 22 '12 at 11:24

Just curious, try using . as your connection point rather then typing localhost, let us know.

  • I tried it and got the same exact error message. I also tried "localhost", my computer name, – Derek Nov 18 '10 at 18:17
  • 1
    hmm take a look at the windows event logs under application to see if anything stands out, also look into the sql logs located in \Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\LOG\ERRORLOG , in addition if this is a named instance your connection might need to be LOCALHOST\SQLNAMED (replace SQLNAMED with actual instance name) – Nick O'Neil Nov 18 '10 at 18:26
  • Yeah, I had tried the named instance thinking that might be it but it didnt work. See my answer...finally figured it out – Derek Nov 18 '10 at 20:05

Is this running on server 2008/Vista or 2008R2/Win7? If so, try running management studio as administrator then logging in with windows auth.

  • See my answer...finally figured it out – Derek Nov 18 '10 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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