Sql Server 2008 Database Engine Login Failed for Administrator User in Windows 7

SQL Server 2008 database engine login failed for administrator user in windows 7

Depending on what mode SQL Server was installed (Windows Authentication or Mixed Mode), you may have to do a few things. If you installed in mixed mode, you can log in as sa and add the administrator user as a Login under the Security section. Make sure you assign sysadmin role to the user, which can be found under Server Roles.

If Windows Authentication mode was chosen during install then there are a couple of things you can do, but I think the easiest is just to recreate the user sadegh, login into SQL Server as that user, and follow the previous step to add the administrator user as a login.

UPDATE: If all else fails, you can run SQL Server in Single User Mode, which allows a single connection to the server, and enable/change the sa password. To do this you can:

  1. Open the command prompt (Right-Click on and select "Run As Administrator")
  2. From the command prompt type net stop MSSQLSERVER
  3. Next type net start MSSQLSERVER /m
  4. Open SQL Server Management Studio. Do not login, cancel the login dialog.
  5. From the file Menu select New->Database engine query, and login (Make sure you use the host name and not localhost).
  6. Execute the query ALTER LOGIN sa WITH PASSWORD = ''; to reset the password (if the sa is not enabled then type ALTER LOGIN sa ENABLE to do so)
  7. Login with the sa user and add the Administrator user.

EDIT:

As indicated by @jimasp in the comments, for step 6 you may have to do ALTER LOGIN sa WITH PASSWORD = '' UNLOCK;, because the sa account may be locked from too many login attempts.

Tested on Windows 7 Ultimate with SQL Server 2008 Standard. Hope this helps.

Cannot login to SQL Server 2008, in Windows 7 x64

Follow the steps in Troubleshooting: Connecting to SQL Server When System Administrators Are Locked Out:

  • Start the instance of SQL Server in single-user mode by using either the -m or -f options.
  • Start command prompt as local administrator
  • Connect to the server: sqlcmd -E -S .
  • Add yourself (computername\username) to the sysadmin SQL group:

    create login [computername\username] from windows;
    exec sp_addsrvrolemember 'computername\username', 'sysadmin';

  • Restart the server in normal mode

And next time pay attention to the options you click during Setup.

Unable to log in to server in SQL Server 2008 R2 Management Studio

You need to add a server login:

  1. Connect to your SQL Server with SSMS as sa.
  2. Drill into the server's Security folder in SSMS's Object Explorer pane.
  3. Right-click on the server's Security > Logins folder that appears in Object Explorer.
  4. Click on New Login... in the context menu that appears.
  5. Provide details of the new login in the Login - New dialog that opens - particularly its General, Server Roles, and User Mappings pages (along the left). (See the screenshots of each page with sample input at the bottom of the answer.)

You may need to add a database user depending on your needs, but a server login (like your sa login) is necessary to connect to the SQL Server instance using Windows or SQL Server authentication. Mapping the new login to a database user (in the Login - New dialog's User Mappings page) will create a new user in the mapped database if you specify a username that does not already exist; alternatively you can map the new login to an existing database user.

Another SO question speaks to the differences between server logins and database users.

Login - New (General page)

SQL Server authentication

Login - New (General, SQL auth)

or

Windows authentication

Login - New (General, Win auth)

Login - New (Server Roles page)

Login - New (Server Roles)

Login - New (User Mappings page)

SQL Server authentication

Login - New (User Mappings, SQL auth)

or

Windows authentication

Login - New (User Mappings, Win auth)

Login to Microsoft SQL Server Error: 18456

If you're trying to connect using "SQL Server Authentication" then you may want to modify your server authentication:

Within the Microsoft SQL Server Management Studio in the object explorer:

  1. Right click on the server and click Properties

  2. Go to the Security page

  3. Under Server authentication choose the SQL Server and Windows Authentication mode radio button

  4. Click OK

  5. Restart SQL Services

Connecting microsoft sql server 2008 r2 to netbeans IDE 7.0 error 18456 severity 14 state 38 login failed

It was a bug in Netbeans's installation. It wasn't fixed even after update. I uninstalled and downloaded the latest netbeans ide, which is 7.2.1, and when I tried it worked without any problems at all.



Related Topics



Leave a reply



Submit