Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
291 views
in Technique[技术] by (71.8m points)

sql server - An attempt to login using SQL authentication failed

I am trying to connect to SQL Server 2008 using 'sa' username and its password. In the SQL Server log file I see this error:

Login failed for user 'sa'. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only.

When I right-clicked on the server -> Properties -> Security "SQL Server and Windows authentication mode" is chosen.
I thought it's a problem with the 'sa' user so I did:

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

But it didn't help.
What else can it be?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It looks like you will need to restart your SQL Server according to the MSDN link on enabling Mixed-Mode Authentication

There is another article (user comment at the bottom) referencing a registry key that you can look at; it also says you will need to restart the service once you have changed it.

From the first link:

To change security authentication mode:

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

  • On the Security page, under Server authentication, select the new server authentication mode, and then click OK.

  • In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.

To restart SQL Server from SQL Server Management Studio

  • In Object Explorer, right-click your server, and then click Restart. If SQL Server Agent is running, it must also be restarted.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...