I accidentally deleted my domain logon from SQL Server LocalDB. It was the only logon on the server.
How can I get access back to my instance? Every time I try connecting I get the message Logon failed for domain\user
.
I tried reinstalling and repairing with no luck.
Did you have any special configuration of your instance that would be hard to recreate? Or maybe user data in masterDB (please don't do this ever again if so)?
If not then you can just delete the instance and recreate it. All user databases will be preserved, although you will need to attach them again.
Assuming we're talking about the automatic instance (v11.0
), just do:
SqlLocalDB delete v11.0
It will be recreated the next time you try connecting to it. It can take 10 seconds or more, so the first connection could timeout.
After that use sp_attach_db() stored proc to attach your user databases again.