I accidentally deleted all logins in my SQL DB, now I can not connect

In any case, to get to the server and recreate them?

+3
source share
3 answers

You will have to reinstall the server, as there is no β€œcapture” available to run anything to restore accounts or create new ones.

Since you cannot backup your databases (again, having no way to get there), you want to stop the SQL Server service (MSSQLSERVER) in the Services panel so that it excludes its exclusive locking of files in your database. Then go to the folder C: \ Program Files \ Microsoft SQL Server \ MSSQL.1 \ MSSQL \ Data and copy all the MDF and LDF files to a safe place.

Then uninstall and reinstall SQL Server (maybe you can just reinstall). After restarting, copy the MDF / LDF files back (NOT the model, msdb or the main database !! Only the ones you created) and β€œattach” them in the SQL window. You will do all this with an integrated Windows account.

+4
source

? , , .

+1

Source: https://habr.com/ru/post/1710116/


All Articles