Fixing issue installing MSSQL in some Windows 11 devices

In this guide, we will learn to troubleshoot on issue where Microsoft SQL Server fails to install Database Engine Service in some modern Windows 11 devices.


Symptoms

When you are installing Microsoft SQL Server on a Windows 11 device, the installation fails at Database Engine Service.

When connecting to the database via SQL Server Management Studio (SSMS), the connection fails with the following error or something similar.

Cannot connect to COMPUTER-NAME.

Additional Information:

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 SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: -2)

The system cannot find the file specified

The Database Engine service inside the Services is not started and can't be started with the following error.

Windows could not start the SQL Server (MSSQLSERVER) service on Local Computer.

Error 1067: The process terminated unexpectedly.


Confirming Symptom

To determine if your device suffer from the following issue, you may run the following command on an elevated command prompt to check if your device will encounter this issue:

fsutil fsinfo sectorinfo C:

If the results for PhysicalBytesPerSectorForAtomicity, PhysicalBytesPerSectorForPerformance, or FileSystemEffectivePhysicalBytesPerSectorForAtomicity is any values other than 512 or 4096, you will encounter issue installing Microsoft SQL Server.

Following is an example of a laptop suffering from such issue:

On a working device, the following will be the output:


Solution

Open an elevated command prompt by searching for cmd in Start Menu, then right click and select Run as Administrator.

Click copy and execute the following command:

REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v "ForcedPhysicalSectorSizeInBytes" /t REG_MULTI_SZ /d "* 4095" /f

The following should be the output:

After this, restart the computer and try installing Microsoft SQL again.


Additional Resources

https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/database-file-operations/troubleshoot-os-4kb-disk-sector-size

 

Copyright © Asia Pacific University. All Rights Reserved.