Table of Contents

  • Introduction
  • Problem Definition
  • Cause
  • Solution
    • Uninstall
    • Fresh install
  • Looking at SQL Server Errorlog
  • Forum threads related to this issue
  • Suggested Readings
  • See Also
 

Introduction

This article is about how to proceed when you get error message 'Could not find database engine startup handle ' while installing SQL Server 2008 R2/2012 or 2014.

↑ Back to top


Problem Definition

If you are an active member of SQL Server Setup and Upgrade forum you must have noticed some users creating a thread with error messages of 'Could not find database engine startup handle ' while installing SQL Server . This article tries to provide a simple solution to this problem, that many users face during installation of SQL Server 2008 R2, SQL Server 2012 and SQL Server 2014 as well.

Let's get started. For resources on installing SQL Server 2008/R2/2012/2014; there are lot of good articles which you find in Suggested Readings section .

Its common belief that installation of SQL Server is very easy,  just do *Next, Next * and installation would be complete.

It is correct, it's simple but internally what all operations go a general user is not aware about it and when he faces issue he feels that SQL Server product is not good ( this is my forum experience where many of Original Poster (OP) get frustrated with SQL Server installation error). It's recommend to read below Microsoft articles before proceeding with installation of SQL Server

  1.  Hardware and Software requirement for installing SQL Server
  2.  Install SQL Server from installation wizard
  3.  How to use SQL Server in win 8 and Windows Server environment

Problem is when a user tries to install SQL Server 2012 or 2014 or 2008 R2 during installation error is flashed which says

Could not find database engine startup handle and some Hex error like '0x851a0019' error could also be 'Wait on the Database Engine recovery handle failed'.

↑ Back to top


Cause

Following can be the reason behind the error message.

  1. The account which user selected on Server Configuration page window ( during installation)  is somehow not able to bring SQL Server database engine services online. Either is lacks privilege or it is corrupted. During installation of database engine services SQL Server tries to bring online database services as a internal process but due to startup account either corrupt or not having appropriate privileges it fails to do so and ultimately installation fails.
  2. Other reason is when installation fails first time due to some reason and user uninstall failed installation from add remove program, the un-installation leaves account in broken state so any further attempt to install flashes this error message.
  3. The reason can be also that SQL Server installation was successful in installing SQL Server and its services but due to some other limitation in system or other system related errors SQL Server is not able to come online. The same has been discussed in section 'Looking at SQL Server errorlog'

↑ Back to top


Solution

A simple solution to above problem is below.

Uninstall

Uninstall SQL Server completely from add remove program. Make sure no previous failed installation fragments are present on your system. Please use this link for uninstalling existing instance of SQL Server. If you have SQL Server 2005 use this link.

--Below Steps should ONLY be followed if removing SQL Server is giving error and if you have used all means to remove SQL Server and you have failed. If you have doubts about the approach please DONT follow it.

If you are unable to uninstall SQL Server completely because you deleted SQL Server files and un-installation is giving error please follow below method. This method is tested and suggested on this thread and  Forum.

Below Solution (about removing reg keys) will work correctly for SQL Server having Just one instance. If you have multiple instances and you have messed up SQL Server installation please contact Microsoft Support personal to get better guidance on removal of SQL Server. Please DONT use this method if you are new to SQL Server take help of experienced DBA to locate proper registry keys and remove them if you are not confident at all it would be better calling Microsoft Support.

Note: Removing necessary registry entries might cause SQL Server instance to crash so backup registry before doing changes.

  • 1. Uninstall the existing SQL Server  and all the components from the add remove program.
  • 2. Backup the registry.
  • 3. Delete the following keys using regedit:
    • --HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server
    • --HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
  • 4. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall and delete all the sub-keys referencing SQL Server.
  • 5. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and delete all the keys referencing SQL Server.
  • 6. Rename all the SQL Server folders in the computer.
  • 7. Reboot the machine.

Fresh install

2. Start a fresh installation. Locate Setup.exe file in SQL Server installable. It would be something like below

Always Right click on Setup file and select Run As Administrator to launch the setup.

After launching the setup and providing necessary details you would reach to Server Configuration page as below. When you reach this page please select startup account for Database Engine services as NT Authority\SYSTEM which is also called as Local System account.

Next you need to proceed as normally you do for installation.You will see this will solve the issue.

After installation completes please change Service Account from NT AUTHORITY\SYSTEM to a low privileged domain account. Please refer to below Microsoft link about how to configure various accounts for SQL Server and what minimum rights to provide

  • Configure Windows Service Account and Permissions

To get information about Local System account please refer to below link

  • Local System Account

Looking at SQL Server Errorlog

Even after following above method if you still get the error this means that problem is not with SQL Server installation something different is blocking SQL Server installation. The important point to note here with such error is you will see SQL Server installed but the services are not online( there might be few exception). Please check SQL Server configuration manager and Services.msc to check whether SQL Server services are present or not. If they are present but in stopped state you must look at log files present at location

Drive:\Program Files\Microsoft SQL Server\MSSQL. n \MSSQL\LOG\ERRORLOG and ERRORLOG. n files.

Where Drive is system drive on which you installed SQL Server. It can be system drive C or any user drive (D,E,F...) . MSSQLn here means version number of SQL Server
n=10 for SQL Server 2008/2008 R2
n= 11 for SQL Server 20012
n=12 for SQL Server 2014.
One such thread with similar issue is this , The problem was not the SQL Server, services were installed but SQL Server cannot start due to error

Cannot use file 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DB_NAME\master.mdf' because it was originally formatted with sector size 4096 and is now on a volume with sector size

Now above error is not related to SQL Server but related to disk drive formatting on which SQL Server master data file resides. Error is beyond the scope of this article hence would not be discussed.

↑ Back to top


Forum threads related to this issue

This article is an outcome of my answer provided to below forum threads which faced issue 'Could not find Database engine startup handle'. Please have a look

  • Could not find database engine startup handle Thread 1
  • Could Not find database engine startup handle thread 2
  • Database engine startup handle issue
  • Similar Thread

If you still cannot find solution to your problem please post your question on SQL Server Setup and Upgrade forum for more assistance.

↑ Back to top


Suggested Readings

  • How to Identify SQL Server Setup issue using setup log files
  • How to install SQL Server 2014
  • How To Install SQL Server On Windows 8
  • How to Install SQL Server 2012
  • How to find location of setup log files generated after SQL Server Installation
  • Installing SQL Server 2012 with SP1 and Product update in One Go

See Also

  • SQL Server General & Database Engine Resources on the TechNet Wiki
  • List of articles by Shanky
  • SQL Server 2014 Portal