1
votes

I installed SQL Server 2012 local db from this download

choosing ENU\x64\SqlLocalDB.MSI

I ran it OK, then tried to use the sqllocaldb command, I got this error:

PS C:\WINDOWS\system32> sqllocaldb start mssqllocaldb 

Start of LocalDB instance "mssqllocaldb" failed because of the following error:
Unexpected error occurred inside a LocalDB instance API method call.
See the Windows Application event log for error details.

The log says this:

Windows API call RegOpenKeyExW returned error code: 2. Windows system error message is: The system cannot find the file specified. Reported at line: 967.

and

LocalDB parent instance version is invalid: MSSQL12E.LOCALDB

and

Windows API call GetSvcBinPathByInstName returned error code: 2. Windows system error message is: The system cannot find the file specified. Reported at line: 3546.

1

1 Answers

7
votes

I fixed it by deleting the instance and recreating it:

PS C:\WINDOWS\system32> sqllocaldb delete mssqllocaldb
LocalDB instance "mssqllocaldb" deleted.
PS C:\WINDOWS\system32> sqllocaldb create mssqllocaldb
LocalDB instance "mssqllocaldb" created with version 11.0.
PS C:\WINDOWS\system32> sqllocaldb i
mssqllocaldb
v11.0