login failed for user (Microsoft SQL Server error: 18456)

So you had some problems with your installation of the SQL Server 2005 installation on your machine and now that you have un-installed and installed it, you can't seem to log on to your own machine using basic windows authentication. You can log into other servers but you just can't seem to log on to localhost. So you search the internet for the error message and after going through a whole lot of issues that are vaguely related, like changing authentication type from windows to sql and so on and so forth, you land on my blog.

The Solution: Install Visual Studio 2005 SP2

This was a bug in SQL Server 2005 that was fixed in SP2.

Published Tuesday, April 08, 2008 4:32 PM by Nilotpal Das

Comments

Thursday, December 25, 2008 3:45 PM by elbasha

# re: login failed for user (Microsoft SQL Server error: 18456)

thank you..

Thursday, January 08, 2009 12:54 AM by Sven

# re: login failed for user (Microsoft SQL Server error: 18456)

Yeah, and why can't i find this damn thing anywhere on the net!?

Friday, March 13, 2009 11:38 PM by Fher

# re: login failed for user (Microsoft SQL Server error: 18456)

Download here: (SP3 Yay!)

www.microsoft.com/.../details.aspx

Monday, March 16, 2009 3:09 AM by sarvajeet

# re: login failed for user (Microsoft SQL Server error: 18456)

I installed service pack 3 for SQL 2005 and still getting the same error message.

Please help what can be possible reasons for this?

Wednesday, November 11, 2009 6:15 AM by napster

# re: login failed for user (Microsoft SQL Server error: 18456)

You have to one thing;

go to Management studio/enterprise manager=>rightclick on it go to Properties =>

go to security => Server authentication=> select SQL Server  and windows authentication mode.

That it.

cheers

Thursday, January 14, 2010 5:11 AM by kiran

# re: login failed for user (Microsoft SQL Server error: 18456)

I installed VS 2008 n' MSSQLserver2008 and gettin d error as login failed for user 'sa'

so pls help me sort out d prblm.

thnx a lot.

Friday, January 15, 2010 12:37 AM by Nilotpal Das

# re: login failed for user (Microsoft SQL Server error: 18456)

Have you installed Visual Studio 2008 Service Pack 1 and SQL Server 2008 Service Pack 1?

Tuesday, May 04, 2010 3:49 PM by Faizan Ali

# re: login failed for user (Microsoft SQL Server error: 18456)

There's no bug in SQL Server 2005. You just need to run it as administrator..

Right Click on short cut and select "run as administrator" It will work nicely

Wednesday, May 05, 2010 1:40 AM by Nilotpal Das

# re: login failed for user (Microsoft SQL Server error: 18456)

You are mistaken. I have UAC down. Everything runs as administrator.

Thursday, May 06, 2010 10:17 AM by roro

# re: login failed for user (Microsoft SQL Server error: 18456)

please try to solve this problem and sent me the solution

Friday, May 28, 2010 10:32 PM by Guru

# re: login failed for user (Microsoft SQL Server error: 18456)

It worked for me when I ran as Administrator.

Thanks for the suggestion.

Tuesday, August 17, 2010 3:37 PM by Arnold

# re: login failed for user (Microsoft SQL Server error: 18456)

This is pitiful. Here's the solution for SQL Server 2005, running from Windows 7:

Start

All Programs

Microsoft SQL Server 2005

Configuration Tools

SQL Server Surface Area Configuration (come on!)

Once this app is running, click on "Add New Administrator"

On to the top right-hand side it'll say "user to provision". Enter your domain \ account info there. Next, just drag what you want from "available privileges" to "privileges that will be granted to [user]"

<sarcasm>

This is so intuitive I can't believe you people haven't figured this out already!

</sarcasm>.

This worked for me. If you think about it, this is MS solution to the pervasive "sa" accounts with no password. Anyhow, good luck.

Tuesday, September 14, 2010 2:04 PM by Kwaz

# re: login failed for user (Microsoft SQL Server error: 18456)

Thanks to Faizan Ali, just followed his advise submitted on May 04, 2010 3:49 PM

# re: login failed for user (Microsoft SQL Server error: 18456)

There's no bug in SQL Server 2005. You just need to run it as administrator..

Right Click on short cut and select "run as administrator" It will work nicely

FURTHER: after running as admin and login in successfully, you will create have to create a new user, on SECURITY> LOGIN> , right-click login and add new user ie the user you just login. Then you wont have to run-as-admin all the time.

Kwaambwa

Thursday, October 28, 2010 5:04 AM by chocoballz

# re: login failed for user (Microsoft SQL Server error: 18456)

Just try to restart your server to refresh your connection.

Saturday, January 22, 2011 2:44 PM by Kabul

# re: login failed for user (Microsoft SQL Server error: 18456)

Thanks every one, it just worked right click run as administrator

Friday, March 04, 2011 6:59 AM by venki

# re: login failed for user (Microsoft SQL Server error: 18456)

It just worked with Run as Administrator. Thanks a lot.

Wednesday, April 27, 2011 5:03 PM by Salimeh Rahimy

# re: login failed for user (Microsoft SQL Server error: 18456)

I use visual studio 2010 and sql server 2008. I can't define a new user. when I try

(Security->logins), error:18456 occured.

Does any one know what should I do?

Wednesday, April 27, 2011 5:07 PM by Salimeh Rahimy

# re: login failed for user (Microsoft SQL Server error: 18456)

I use visual studio 2010 and sql server 2008. I can't define a new user. when I try

(Security->logins), error:18456 occured.

Does any one know what should I do?

Thursday, June 02, 2011 3:16 PM by saeed

# re: login failed for user (Microsoft SQL Server error: 18456)

thanks aloooooooooooooooottttttttttt

Saturday, June 18, 2011 5:37 PM by raj vardhan

# re: login failed for user (Microsoft SQL Server error: 18456)

thanks...worked with run as admin

Monday, July 04, 2011 2:19 AM by Natarajan

# re: login failed for user (Microsoft SQL Server error: 18456)

It looks simple but very very useful answer and the exact answer and i thank u a lot... i really gone mad because of this error

Wednesday, July 13, 2011 5:51 AM by anil verma

# re: login failed for user (Microsoft SQL Server error: 18456)

erver Authentication. The 'sa' login details are correct but still getting the following error message:

Quote:

Login failed for user 'sa'. (Microsoft SQL Server, Error: 18456)

In order to resolve the issue, please refer to the following steps:

1. Login to the MSSQL Server Management Studio with Windows Authentication.

2. In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.

3. Under the Server Properties, select a page of "Security".

4. Select the Server authentication as "SQL Server and Windows Authentication mode" and click Ok.

5. Restart the SQL Services and then try to login with 'sa' details.

Thursday, September 15, 2011 4:35 AM by venkat

# re: login failed for user (Microsoft SQL Server error: 18456)

please give me the step by step answer for this one ,,,,

Friday, November 11, 2011 3:19 PM by harini

# re: login failed for user (Microsoft SQL Server error: 18456)

i have right-clicked it and used "run as admin...", but i still get 18456 error... please suggest...

Tuesday, February 07, 2012 9:51 AM by anji

# re: login failed for user (Microsoft SQL Server error: 18456)

ALTER LOGIN sa ENABLE ;

   GO

   ALTER LOGIN sa WITH PASSWORD = '<enterStrongPasswordHere>' ;

   GO

Leave a Comment

(required) 
(required) 
(optional)
(required)