Sunday, June 8, 2025

Creation of LocalDB instance "mssqllocaldb" failed because of the following error: Error occurred during LocalDB instance startup: SQL Server process failed to start.

If you have the error above during SQL Server LocalDB creation or starting, it might due to strange behavior on several versions of SQL Server, including SQL Server 2022. 
First, try to recreate the LocalDB instance first if you are using LocalDB.
sqllocaldb stop MSSQLLocalDB
sqllocaldb delete MSSQLLocalDB
sqllocaldb create MSSQLLocalDB
sqllocaldb start MSSQLLocalDB
If still getting the same error, check the error log for the SQL Server which located at below.
%LocalAppData%\Microsoft\Microsoft SQL Server Local DB\Instances\mssqllocaldb
Inspect the last few lines of the error, you might get the error below.
2025-06-08 21:37:49.09 spid10s     There have been 256 misaligned log IOs which required falling back to synchronous IO.  The current IO is on file C:\Users\xxxx\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\mssqllocaldb\master.mdf.
If that is the error you have, you might need to add ForcedPhysicalSectorSizeInBytes to your Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device registry. Please head to Troubleshoot errors related to system disk sector size greater than 4 KB for Microsoft official resolution. 

Reference: 
https://learn.microsoft.com/en-us/answers/questions/1573054/creation-and-start-of-localdb-failure

No comments:

Post a Comment