PDA

View Full Version : مشکل لاگین ادمین در SQL Server 2008



goldpower
پنج شنبه 12 دی 1392, 19:55 عصر
بع
سلام
SQL Server 2008 نصب کردم . بعد وارد SQL Server Management Studio شدم و لاگین کردم.
از داخل دیتا بیس اشتباهی یوزر ادمین( samsung ) پاک کردم حالا دیگه لاگین نمی شه !!!!!!!!!!!!!!!!


114741

goldpower
پنج شنبه 12 دی 1392, 20:37 عصر
این روش پیدا کردم اما جواب نداد؟؟


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:


Open the command prompt (Right-Click on and select "Run As Administrator")
From the command prompt type net stop MSSQLSERVER
Next type net start MSSQLSERVER /m
Open SQL Server Management Studio. Do not login, cancel the login dialog.
From the file Menu select New->Database engine query, and login (Make sure you use the host name and not localhost).
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)
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.

حمیدرضاصادقیان
جمعه 13 دی 1392, 00:34 صبح
سلام.
آیا باSQL Authentication و SA نمیتونید وارد بشید؟