How to fix MSSQLLocalDB?

On my machine, MSSQLLocalDB got corrupted:

PS C:\WINDOWS\system32> sqllocaldb i
MSSQLLocalDB
Projects
ProjectsV12
v11.0
PS C:\WINDOWS\system32> sqllocaldb i mssqllocaldb
The required LocalDB version "0.0" is not installed.
PS C:\WINDOWS\system32>

Is there anything I can do to reinstall Visual Studio / Sql Server / Sql Express to fix it?

It should be noted that any functionality of Visual Studio that depends on LocalDb does not work because of this, for example CodeMaps

+4
source share
4 answers

What I finished follows. Note that I'm sure this is not the right way to do this, but rather a messy hack. This allowed me to get my CodeMaps working again, so I'm happy.

I deleted mssqllocaldb

sqllocaldb d mssqllocaldb

The system will not allow me to create it again, so I created another:

sqllocaldb  mssqllocaldb1

"C:\Users\[username]\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\" mssqllocaldb. MSSQLLocalDB1 mssqllocaldb.

HKCU\Software\Microsoft\Microsoft SQL Server\UserInstances\ DataDirectory, , mssqllocaldb MSSQLLocalDB1.

mssqllocaldb CodeMaps:

PS C:\WINDOWS\system32 > sqllocaldb s mssqllocaldb

LocalDB "MSSQLLocalDB".

+2

, LocalDB . , ( , ), :

C:\Users\sweaver>sqllocaldb.exe s MSSQLLocalDB
LocalDB instance "MSSQLLocalDB" started.

, - , .


LocalDB (2014)

C:\Users\sweaver>sqllocaldb.exe i
v11.0

C:\Users\sweaver>sqllocaldb.exe i
MSSQLLocalDB
v11.0

C:\Users\sweaver>sqllocaldb.exe i MSSQLLocalDB
The required LocalDB version "0.0" is not installed.

! 11 -

C:\Users\sweaver>sqllocaldb.exe i v11.0
Name:               v11.0
Version:            11.0.5343.0
Shared name:
Owner:              RR2014\sweaver
Auto-create:        Yes
State:              Running
Last start time:    3/10/2016 3:00:29 PM
Instance pipe name: np:\\.\pipe\LOCALDB#60C1AC49\tsql\query

C:\Users\sweaver>sqllocaldb.exe v
Microsoft SQL Server 2012 (11.0.5343.0)
Microsoft SQL Server 2014 (12.0.2000.8)

C:\Users\sweaver>sqllocaldb.exe s MSSQLLocalDB
LocalDB instance "MSSQLLocalDB" started.

...

C:\Users\sweaver>sqllocaldb.exe i MSSQLLocalDB
Name:               MSSQLLocalDB
Version:            12.0.2000.8
Shared name:
Owner:              RR2014\sweaver
Auto-create:        Yes
State:              Running
Last start time:    3/10/2016 3:10:55 PM
Instance pipe name: np:\\.\pipe\LOCALDB#1D3F49F3\tsql\query

! !

+10

, reg. .

C:\Users\username\AppData\Local\Microsoft\Microsoft SQL Server \\MSSQLLocalDB

, MSSQLLocalDB, HKEY_CURRENT_USER\SOFTWARE\Microsoft\Microsoft SQL Server\UserInstances {B0A12082-AC5B-4E05-A0C9-ABFB6816EE16}

cmd

C: > sqllocaldb c MSSQLLocalDB

LocalDB "MSSQLLocalDB", 13.0.2151.0.

0

I just updated the GUID of the registry key under HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\UserInstances\to the correct value ParentInstancethat worked for me. This usually happens when upgrading to higher versions. I need to change the ParentInstance value from MSSQL12E.LOCALDBtoMSSQL13E.LOCALDB

0
source

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


All Articles