I get a strange error when installing MS SQL Server 2019 on Windows Server 2022. The installation fails with the error “Could not find the Database Engine startup handle“.
The SQL installation log (summary.txt) contains the following error:
Feature: Database Engine Services Status: Failed: see logs for details Reason for failure: An error occurred during the setup process of the feature. Next Step: Use the following information to resolve the error, uninstall this feature, and then run the setup process again. Component name: SQL Server Database Engine Services Instance Features Component error code: 0x851A0019 Error description: Could not find the Database Engine startup handle.
A similar error may occur when trying to install SQL Server 2022 Express edition:
Unable to install SQL Server Exit code: -2061893607 Error description: Could not find the Database Engine Startup handle.
SQL Server installation error possible causes:
- The service account doesn’t have permission to start the Database Engine service.
- The drive on which the SQL Server is installed is formatted with a sector size greater than 4 KB (this problem is specific to Windows 11 and Windows Server 2022)
- TLS 1.2 protocol support is disabled on the server (required for SQL Server 2016 and newer)
When using the default Microsoft SQL Server installation settings, an unprivileged account of the form NT Service\MSSQLSERVER
is used to start the SQL Server service. This account may not have sufficient privileges to start the SQL Server service, so when the installer tries to start the service, it fails with the error ‘Could not find the Database Engine startup handle’.
To fix SQL Server installation error:
- Correctly uninstall all SQL Server components via the Control Panel and restart the server. After the uninstall, check that there are no SQL Server components on the computer:
wmic product get Name,IdentifyingNumber | findstr /i "SQL"
If any features remain, remove them by their GUIDs using the command:
msiexec /x {guid}
Check that there are no files or folders inC:\Program Files\Microsoft SQL Server\MSSQLxxx.xxx
) - Perform a clean installation of the SQL Server
- On the Server Configuration tab, change the account used to run the SQL Server database engine from
NT Service\MSSQLSERVER
toNT AUTHORITY\SYSTEM
. - Continue the SQL Server installation. The error shouldn’t appear again.
After the installation, change the account used to run the SQL Server Database Engine service to a non-privileged account (this improves security). This account doesn’t necessarily need to have local administrator permissions (it only needs permissions in SQL Server security settings). You can use accounts with sysadmin privileges: NT Service\MSSQLSERVIC
or NT Service\SQLSERVERAGENT
, or a service domain account. To change the account under which SQL Server is running:
- Run the SQL Server Configuration Manager and go to SQL Server Services
- Click SQL Server (MSSQLSERVER), then click Browse and in the “This account” field specify the account, under which the service must be run, or use a gMSA (Group Managed Service Account). Enter the user password and save the changes; The specified account must have permission to log on as a service. Check the GPO option Log on as a service under Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment.
- Restart SQL Server services
Another possible cause of this SQL Server installation error on Windows 11 and Windows Server 2022 is trying to place the master database file on a partition formatted with a sector size larger than 4 KB. The following warning will appear in the SQLServer_ERRORLOG_ log in this case
Cannot use file C:\MSSQLSERVER\MSSQL\DATA\master.mdf because it was originally formatted with sector size 4096 and is now on a volume with sector size 16384. Move the file to a volume with a sector size that is the same as or smaller than the original sector.
Check the allocation unit size on the drive:
fsutil fsinfo sectorinfo c:
In this example, the PhysicalBytesPerSectorForPerformance
sector size value is over 4K.
To fix this, format the partition where the master database will be located with a cluster size of 4K or install SQL Server on a different drive. As a workaround, configure a registry parameter that forces the sector size to be emulated as 4 KB (Troubleshoot errors related to system disk sector size greater than 4 KB).
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v "ForcedPhysicalSectorSizeInBytes" /t REG_MULTI_SZ /d "* 4095" /f
Restart the computer and perform a clean installation of SQL Server.
Check that TLS 1.2 encryption support is enabled on the Windows host where you are installing SQL Server. It is a prerequisite for installing SQL Server 2016 and later (SQL Server 2017, 2019, and 2022). Use the IISCrypto
tool to check that TLS 1.2 is enabled (see How to enable support for the TLS 1.2 protocol in Windows).
These methods can help you fix the “Could not find the Database Engine startup handle” with any version of SQL Server (2022, 2019, 2016, 2014, 2012, or 2008 r2).
4 comments
THANK YOU!
I had this problem fpr two days and i couldn’t figure out whats wrong.
Every other solution didn’t work, but this finally worked!
I encountered the same issue. For me installing TLS 1.2 fixed the issue.
thanks for the info!
Did the problem appear on Windows Server 2012 r2?
I had this problem in Windows 11 Pro. Your advice helped. Thank you very much!