How to fix SQL Server error 17113 (the service will not start)
This means the SQL Server service cannot start because it cannot open the master database, the error log or the master log. The error log tells you which file and why. Read it, fix the startup parameters or permissions, and the service starts again. Jump to your situation below or work through the methods in order.
By Neeraj Singh ~9 min Updated Jun 2026 95% found this helpful
Error message
The SQL Server (MSSQLSERVER) service could not be started. A service specific error occurred: 17113. ERRORLOG: Error: 17113, Severity: 16, State: 1. Error 2(The system cannot find the file specified.) occurred while opening file 'master.mdf' to obtain configuration information at startup.
Summary
Error 17113 means the SQL Server service tried to start but could not open one of the files it needs, almost always the master database (master.mdf), the error log (ERRORLOG) or the master log (mastlog.ldf). Because master holds the location of every other database, SQL Server cannot start without it. The error log records exactly which file and which operating system error: 2 means the file is missing, 3 means the path is wrong, 5 means access is denied and 32 means the file is locked. The fix is to read the log, then correct the startup parameters in SQL Server Configuration Manager, restore the missing file or grant the service account permission, and start the service again.
What this error means
Error 17113 (Severity 16) is a startup failure, not data loss on its own. When the SQL Server service starts, it reads three startup parameters: -d for the master data file, -l for the master log file and -e for the error log. If it cannot open any of those, it logs error 17113 and shuts down. The master database is special because it records where every other database lives, so SQL Server refuses to start without it.
Windows shows only a generic "service specific error 17113" in the Services console, so the real clue is in the SQL Server ERRORLOG and the Application event log. The log line names the exact file and an operating system error number that tells you why: 2 file not found, 3 path not found, 5 access denied or 32 file in use. Match the fix to that number.
Common causes
A startup parameter (-d, -l or -e) points to the wrong path after a move or a typo.
The master.mdf or mastlog.ldf file was moved, renamed or deleted.
The SQL Server service account lacks NTFS permission on the data or log folder (OS error 5).
The drive holding master is offline, disconnected or has a changed drive letter.
The ERRORLOG folder does not exist or is not writable, so SQL cannot create the log (Event 17058).
Antivirus or another process has the master file locked (OS error 32).
An invalid startup option or trace flag was added to the service.
Expert insight
“17113 sends people into a panic about a corrupt database, but nine times out of ten it is just a path or a permission. I never guess, I open the ERRORLOG in Notepad and read the operating system error number on the 17113 line. A 2 or a 3 means a startup parameter is pointing at the wrong place, so I fix the -d, -l and -e paths in Configuration Manager. A 5 means the service account lost rights to the folder. Only when the file is truly gone do I restore master from backup.”
Manager, Tech Support & Operations · 19+ years fixing Windows and system errors
✓ How to fix it
Method 1
Read the SQL Server error log to find the cause
1The 17113 line names the file and an operating system error number. Since the service is down, open the ERRORLOG file directly in Notepad. Its folder is the -e startup parameter, usually ...\MSSQL\Log\ERRORLOG.
2You can also check the Windows Application event log (Event Viewer > Windows Logs > Application) for source MSSQLSERVER, events 17113 and 17058.
3Note the file named and the OS error: 2 (not found), 3 (path wrong), 5 (access denied) or 32 (locked). Once SQL is running again you can read the log with:
EXEC sys.xp_readerrorlog 0;
Method 2
Check and fix the startup parameters
1Open SQL Server Configuration Manager, select SQL Server Services, right-click your instance, choose Properties, then the Startup Parameters tab.
2Confirm the three paths exist and are correct. They should look like this, with your own instance folder:
3Fix any wrong path or typo (a missing space after -d or a moved DATA folder is common), click OK and restart the service.
Method 3
Verify the master files exist at those paths
1Open the folders from the -d and -l parameters in File Explorer and confirm master.mdf and mastlog.ldf are actually there.
2If the drive letter changed or the disk is offline, fix that in Disk Management, then recheck the paths.
3If the files were moved, either move them back or update the startup parameters to the new location, then start the service.
Method 4
Grant the service account permission (OS error 5)
1An OS error 5 on the 17113 line means access denied. Find the service account in Configuration Manager (the Log On As column), often NT SERVICE\MSSQLSERVER.
2In File Explorer, right-click the DATA and Log folders, choose Properties > Security, and give that account Full Control.
3Apply the change, then start the SQL Server service again.
Method 5
Fix a missing or unwritable ERRORLOG folder (Event 17058)
1If the log names the ERRORLOG path with OS error 3, the Log folder is missing or the -e path is wrong. Recreate the folder, or correct -e in the Startup Parameters tab.
2Make sure the service account has write permission on the Log folder.
3Start the service. SQL recreates the ERRORLOG and continues startup.
Method 6
Release a locked master file (OS error 32)
1OS error 32 means another process holds the file. Exclude the SQL Server DATA and Log folders, and the .mdf and .ldf files, from real-time antivirus scanning.
2Check for backup agents or indexing services that may have the file open, and stop them.
3Reboot to clear any stale lock, then start the SQL Server service.
Method 7
Restore or rebuild a missing master database
1If master.mdf is genuinely missing or corrupt and you have a backup, start the instance in single-user mode from an elevated command prompt:
net start MSSQLSERVER /m
2Connect with sqlcmd and restore master, then restart the service normally:
sqlcmd -S . -E -Q "RESTORE DATABASE master FROM DISK = 'D:\Backup\master.bak' WITH REPLACE"
3If there is no backup, rebuild the system databases with SQL Server setup, then restore your user databases:
1After the fix, start the service from Configuration Manager or with:
net start MSSQLSERVER
2Connect and read the latest log entries to confirm a clean startup:
EXEC sys.xp_readerrorlog 0;
3Check that the startup parameters now point to valid paths so the service survives the next restart.
Change one thing at a time. The 17113 error log line tells you the exact file and OS error, so fix that specific cause, a path, a permission, a missing file or a lock, rather than reinstalling. Keep a current backup of the master, model and msdb system databases so you can always restore master if the file is ever lost.
Frequently asked questions
What does SQL Server error 17113 mean?
It means the SQL Server service could not open a file it needs at startup, usually the master database, the error log or the master log. Because master records the location of every database, the service cannot start without it.
Where is the SQL Server error log?
By default it is in the instance Log folder, for example ...\MSSQL\Log\ERRORLOG, set by the -e startup parameter. The service is down, so open ERRORLOG in Notepad, or check the Windows Application event log for events 17113 and 17058.
What do the numbers after error 17113 mean?
They are operating system error codes for the file SQL tried to open. 2 means the file is not found, 3 means the path is wrong, 5 means access is denied and 32 means the file is in use. Each one points to a different fix.
How do I fix the startup parameters?
Open SQL Server Configuration Manager, right-click the instance, choose Properties then Startup Parameters, and make sure -d, -l and -e point to the real master.mdf, mastlog.ldf and Log folder. Correct any wrong path and restart the service.
Do I need to reinstall SQL Server?
Almost never. 17113 is usually a path, a permission or a missing file, not a broken install. Fix the exact cause shown in the error log first. Reinstalling or rebuilding the system databases is a last resort.
Will I lose my databases?
No. Fixing a path or a permission does not touch your data. Only rebuilding the system databases resets master, model and msdb, so back them up first and restore your user databases afterwards.
Still not working?
If the service still will not start after matching the fix to the error log, the master database itself may be corrupt or the disk may be failing. Test the disk, restore master from a known-good backup, and on a production server engage your DBA before rebuilding system databases. You can also submit your error to us for a tailored fix.