The root of the problem
SQL Server or SQL Server Agent startup errors usually occur after changes to security policies or domain credentials. These services depend on specific service accounts (NT SERVICE) that must have the proper permissions to access system resources. When these permissions are lost or modified, the service fails to start correctly.The most common issues include the loss of privileges on the system's registry folders or changes to the credentials of the user account assigned to run the services. Additionally, errors such as
Access is denied on the data folders (MSSQLDATA) indicate NTFS permission problems.
How to reassign the recommended service accounts
To fix these issues, follow these steps:
- Open SQL Server Configuration Manager from the Start menu.
- Select the service showing the error (for example, SQL Server or SQL Agent).
- Click Properties and go to the Log On tab.
- Change the service account to a recommended account, such as NT SERVICEMSSQLSERVER for SQL Server or NT SERVICESQLSERVERAGENT for SQL Agent.
- Make sure to avoid accounts with excessive privileges for security reasons.
- Restart the service to apply the changes.
Fixing NTFS permissions on the data folders
If the SQL Server engine throws an access denied error, follow these steps to fix the NTFS permissions:
- Locate the data folder (MSSQLDATA) and the transaction log folders.
- Right-click the folder and select Properties.
- Go to the Security tab and click Edit.
- Add the service account (for example, NT SERVICEMSSQLSERVER) and grant it full permissions.
- Apply the changes and restart the SQL Server service.
Frequently Asked Questions (FAQs)
Which service accounts are recommended for SQL Server?
The recommended accounts are
NT SERVICEMSSQLSERVER for SQL Server and NT SERVICESQLSERVERAGENT for SQL Server Agent. These accounts have the necessary permissions to run the services.
How can I check whether the NTFS permissions are correct?
Open the folder's properties, go to the
Security tab, and verify that the service account has full permissions on the folder.
What should I do if the service still won’t start?
Check the Windows and SQL Server event logs to identify specific error messages. You can also refer to the
official documentation for more information.