Cannot Start Localdb

Cannot start LocalDB

When all else fails and you don't care about data loss, delete and recreate your LocalDB\v11.0 database! At the command prompt

sqllocaldb delete v11.0
sqllocaldb create v11.0

(Sqllocaldb is in your PATH right? It was for me.)

Unable to connect to the (localdb)\MSSQLLocalDB

The error message in the Windows log about the missing registry value suggests your localdb instance is corrupt. You can recreate the MSSQLLocalDB instance and registry entries by running these commands from a command prompt:

sqllocaldb delete MSSQLLocalDB
sqllocaldb create MSSQLLocalDB -s

Cannot start localdb on startup

The localDB instance should start up when you first try to access the database. After a few minutes of inactivity, the instance will close and only start again when you try to access the database.

There should be no need to "manually" start localDB, although I have noticed sometimes that the application does not automatically start, though this is intermittent and I can find no explanation for it.

EDIT

In order to try to start LocalDB when the application first loads, put this in your Program.cs file, in the Main() function:

Process.Start("sqllocaldb.exe", "start v11.0");

This will attempt to spin-up the localDB exe on application startup.

Cannot connect to (LocalDB)\MSSQLLocalDB - Login failed for user 'User-PC\User'

Warning: this will delete all your databases located in MSSQLLocalDB. Proceed with caution.

The following command through sqllocaldb utility works for me.

sqllocaldb stop mssqllocaldb
sqllocaldb delete mssqllocaldb
sqllocaldb start "MSSQLLocalDB"

Sample Image

After that I restarted the sql server management studio, and it is successfully established connection through (LocalDB)\MSSQLLocalDB



Related Topics



Leave a reply



Submit