Cannot connect to (LocalDB)\MSSQLLocalDB. A network-related or instance-specific error occurred while establishing a connection to SQL server. The server was not found or was not accessible. Verify that the instance name is correct and that the SQL server is configured to allow remote connections.(provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Error occurred during LocalDB instance startup: SQL Server process failed to start.)( Microsoft SQL server)
Yesterday I was able to connect to the (LocalDB)\MSSQLLocalDB and was able to see all the databases in it in SQL server management studio. But today when I am trying to connect, am getting the above mentioned error.
How I was able to connect yesterday but why not now? Please help me.
CodePudding user response:
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