I deleted the localdb instance files which were located in
"C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\v11.0"
by accident. The system cannot start the localdb instance now. The way that I know how to fix the issue is to delete the instance by command
"sqllocaldb delete instancename"
, and re-create the instance again. But I found this approach could only work for user account if I deleted the instances files located in
"C:\Users\UserName\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\v11.0"
So how can I solve this problem to delete the db instance owned by System?
In order to be deleted, first it should be stopped. Type the SqlLocalDB stop MSSQLLocaDB command in the Command Prompt window: LocalDB instance “MSSQLLocalDB” stopped. Now, repeat the SqlLocalDB delete MSSQLLocalDB command.
Once installed, LocalDB is an instance of SQL Server Express that can create and open SQL Server databases. The system database files for the database are stored in the local AppData path, which is normally hidden.
Open "Command Prompt" Type line "sqllocaldb info" and check the name. By default, it will show "MSSQLLocalDB".
Get PsExec from here: http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
Run cmd.exe as LocalSystem as demonstrated in this link:
How do you run CMD.exe under the Local System Account? psexec -i -s cmd.exe
Now you can run
SqlLocalDb stop InstanceName
and
SqlLocalDb delete InstanceName
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With