SQL Server 2008 Database Database Login Failed for Administrator User in Windows 7

I installed SQL Server 2008 Enterprise Edition on Windows 7 Ultimate from sadegh user.

This account exists as an administrator. after a few days I deleted the sadegh user from Windows and now I am using the admin user. But I cannot log in to the SQL Server database using the Windows authentication method, and I get this error message:

TITLE: server connection

Unable to connect to SADEGH-PC.

ADDITIONAL INFORMATION:

Login failed for user 'Sadegh-PC \ Administrator. (Microsoft SQL Server, Error: 18456)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476

Please help me! thank

+5
source share
4 answers

Depending on the mode in which 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 an administrator user as a login to the Security section. Make sure you assign the sysadmin role to the user, which can be found in the Server Roles section.

Windows, , , , sadegh, SQL Server , - .

: , SQL Server , / sa. :

  • ( " " )
  • net stop MSSQLSERVER
  • net start MSSQLSERVER/m
  • SQL Server Management Studio. , .
  • "" "" > " " (, , localhost).
  • ALTER LOGIN sa WITH PASSWORD = ''; reset ( sa , ALTER LOGIN sa ENABLE). )
  • sa Administrator.

EDIT:

@jimasp , 6 ALTER LOGIN sa WITH PASSWORD = '' UNLOCK;, sa - .

Windows 7 Ultimate SQL Server 2008 Standard. , .

+26

SQL BUILTIN\Administrators ​​ sysadmin. SQL 2008. , , . , , , .

sa Windows (, ).

+5

If you do not want to use SQL Server Management Studio, and you can log in as the user who installed the SQL server, try this from the command line:

OSQL -S <insert_servername_here> -E
1> EXEC sp_password NULL, ‘<insert_new_password_here>’, ‘sa’
2> GO
+2
source

The reason I was getting this error was due to the fact that the same connection was opened several times, but it never closed, and such a connection pool was maximal.

In short, check the closure of all your connections.

0
source

All Articles