Resolving The "Login Failed For User 'sa'..." Error.

One of the following issues can cause the "Login failed for user 'sa'... error message:

1. User Account Lockout

If nothing on your database server has changed, it's possible that the SQL Server user account has been "locked out" after too many failed attempts. First, make sure that's the not the case and refer to the following article.

SQL Server User Account Locked Out

2. Changed Password

Did someone change the SQL Server user account password?

  1. Run SQL Server Management Studio on the computer running SQL Server (Check this article if you don't see it on your server.)

  2. Make sure the Server name is correct (ie COMPUTERNAME\ACCTIVATE)

  3. Select Windows Authentication from the Authentication drop-down, then click Connect to log in to SQL Server

  4. In the Object Explorer (usually on the left), expand the Security folder, then Logins folder.

  5. Right-click on the sa account and select Properties.

  6. On the General page, enter a new password in the Password and Confirm password fields.

  7. Go to the Status page, ensure that Login is set to Enabled and Click OK.

3. Windows Authentication

If the error mentions a "trusted" connection, the database server may be configured to require Windows Authentication:

Login failed for user ‘sa’. The user is not associated with a trusted SQL Server connection

The following instructions are for SQL Server 2022, but are very similar in other versions:

  1. Run SQL Server Management Studio on the computer running SQL Server (Check this article if you don't see it on your server.)
  2. Make sure the Server name is correct (ie COMPUTERNAME\ACCTIVATE)
  3. Select Windows Authentication from the Authentication drop-down, then click Connect to log in to SQL Server
  4. Right-click on the server's name (ie COMPUTERNAME\ACCTIVATE) and choose Properties.
  5. Click Security in the list on the left.
  6. Select SQL Server and Windows Authentication mode on the right and click OK.
  7. Click OK to close the warning about restarting SQL Server
  8. Right-click on the server's name (ie COMPUTERNAME\ACCTIVATE) and choose Restart and click Yes to restart SQL Server.

Từ khóa » đăng Nhập Sql Server 2005