I uninstalled my previous SQL Server installation and did a clean install of a new version. Now the database service refuses to start up properly.
Error Details
When I try starting the service through SQL Server Configuration Manager, I get this message:
“The request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details.”
Troubleshooting Steps
I ran this command to get more details: sqlservr.exe -s SQLEXPRESS -e D:\debug.log
Here’s what the log shows:
2017-05-09 19:15:22.12 Server Microsoft SQL Server 2016 (RTM) - 13.0.1601.5 (X64)
Apr 29 2016 23:23:58
Copyright (c) Microsoft Corporation
Enterprise Edition (64-bit) on Windows 10 Pro 6.3 <X64> (Build 10586: )
2017-05-09 19:15:22.12 Server UTC adjustment: 3:00
2017-05-09 19:15:22.12 Server (c) Microsoft Corporation.
2017-05-09 19:15:22.12 Server All rights reserved.
2017-05-09 19:15:22.12 Server Server process ID is 8744.
2017-05-09 19:15:22.12 Server System Manufacturer: 'ASUSTeK COMPUTER INC.', System Model: 'X550JX'.
2017-05-09 19:15:22.13 Server Authentication mode is WINDOWS-ONLY.
2017-05-09 19:15:22.13 Server Logging SQL Server messages in file 'D:\debug.log'.
2017-05-09 19:15:22.13 Server The service account is 'DESKTOP-PC\Administrator'. This is an informational message; no user action is required.
2017-05-09 19:15:22.13 Server Command Line Startup Parameters:
-s "SQLEXPRESS"
-e "D:\debug.log"
2017-05-09 19:15:22.13 Server Error: 17113, Severity: 16, State: 1.
2017-05-09 19:15:22.13 Server Error 3(The system cannot find the path specified.) occurred while opening file 'master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary.
2017-05-09 19:15:22.14 Server SQL Server shutdown has been initiated
What I’ve Tried
I already attempted setting permissions for the Windows user account, Local System, and Local Service but none of these fixes worked.
error 3 usually indicates SQL can’t find the files in the default locatoin. maybe check your registry for old entries that point to your previous install path - uninstalls don’t always clean everything up. hope this helps!
your master database got wiped during the uninstall - been there, total nightmare lol. Run setup.exe /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=SQLEXPRESS to rebuild the system databases. should recreate master.mdf and get you back up.
Your SQL Server database service is failing to start after a clean reinstallation, displaying the error message: “The request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details.” The debug log reveals error 3 (The system cannot find the path specified.) while attempting to open master.mdf, indicating a problem locating the database files.
Understanding the “Why” (The Root Cause):
The master.mdf file is the core system database for SQL Server. If SQL Server can’t find it in the expected location, the service won’t start. This often happens after reinstalling SQL Server, especially when upgrading versions, because the installer might not correctly update all necessary file paths in the Windows Registry or the service configuration. The error suggests the SQL Server service is looking for the master.mdf database file in an incorrect location, possibly leftover from a previous installation.
Step-by-Step Guide:
Step 1: Verify and Correct Database File Paths in the Registry:
Open the Registry Editor (regedit.exe).
Navigate to the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\[InstanceName]\MSSQLServer\Parameters. Replace [InstanceName] with the name of your SQL Server instance (e.g., SQLEXPRESS).
Locate the -d (database path) and -l (log file path) parameters. These parameters specify the location of your master.mdf and log files.
Check if the paths are correct: Do they point to the actual location of your master.mdf file after the clean install? If not, correct the paths to reflect the new installation directory. Incorrect paths are the most likely cause of this error.
Restart the SQL Server service after making changes to the registry.
Step 2: (Alternative) Repair SQL Server Installation:
If you’re uncomfortable directly modifying the registry, try a less invasive approach:
Run the SQL Server setup executable again.
Choose the repair option. This will attempt to automatically fix any file path inconsistencies and other issues with your installation.
Step 3: (Alternative) Rebuild System Databases (Advanced)
Use this option only if other methods fail. This will delete and recreate all system databases, including master.mdf, potentially leading to data loss if not approached carefully.
Open a command prompt as an administrator.
Execute the following command, replacing SQLEXPRESS with your instance name if necessary: setup.exe /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=SQLEXPRESS
This command will rebuild the system databases. Proceed with extreme caution, as this will erase any existing data in your SQL Server instance.
Common Pitfalls & What to Check Next:
Incorrect Instance Name: Double-check that you’re using the correct instance name (SQLEXPRESS or another) throughout the process.
Insufficient Permissions: Ensure the SQL Server service account has the necessary permissions to access the specified database file locations.
Disk Space: Verify that you have enough free disk space on the drive where the master.mdf database is located.
Antivirus Interference: Temporarily disable your antivirus software to rule out any conflicts. Re-enable it after you’ve resolved the issue.
Still running into issues? Share your (sanitized) config files, the exact command you ran, and any other relevant details. The community is here to help!