Windows failed to start SQL Server (MSSQLSERVER) on the local computer ... (error code 3417)

For some reason, I moved this folder: ( Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL ) to another drive, and then returned it to the same place, but the sql server stops working, showing this error when trying to start it again:

Windows failed to start SQL Server (MSSQLSERVER) on the local computer. See the system event log for more information. If this is a service other than Microsoft, contact your service provider and refer to service error code 3417.

I tried a lot of the solutions discussed in different forums, but none of them work for me.

The folder is not compressed or encrypted.

 My sql server version is 2012: Microsoft SQL Server Management Studio 11.0.3128.0 Microsoft Analysis Services Client Tools 11.0.3128.0 Microsoft Data Access Components (MDAC) 6.1.7601.17514 Microsoft MSXML 3.0 4.0 6.0 Microsoft Internet Explorer 9.0.8112.16421 Microsoft .NET Framework 4.0.30319.18047 Operating System 6.1.7601 

Thanks for your kind help in advance.

+13
source share
15 answers

It is very simple to solve this problem.

Just open the RUN window (Window + R) and enter services.msc :

Services.msc window

Locate SQL in the name column and right-click on it.

right click on SQL as in the screenshot

You will get a property option, click on properties.

One new window will open, and you should click on the " Login " tab. And select the local system account. then apply and everything is in order.

Select a local system account

After that, go back to the services.msc window. and right click on sql and click start .

Finally, SQL Server services were started successfully. enjoy and keep learning.

+17
source

Make sure that you are compressing the driver or the folder in which you place the .mdf file.

If so, plesae go to the driver or folder, change the compression setting to

Properties β†’ The "Compress content to save disk space" checkbox is promoted and disabled.

Then you can start the service again.

+14
source

In my specific case, I fixed this error by looking in the Event Viewer to get an idea of ​​the source of the problem:

enter image description here

Then I followed the steps in Restoring the primary database in SQL Server .

Note. Make some good backups first. After deleting the main database, you will have to reconnect to all existing databases by going to .mdf files .

In my particular case, the command to rebuild the master database was:

 C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012>setup /ACTION=rebuilddatabase /INSTANCENAME=MSSQLSERVER /SQLSYSADMINACCOUNTS=mike /sapwd=[insert password] 

Please note that this will return the SQL server to its default settings, so you should hope that you can restore the main database from E:\backup\master.bak . I could not find this file, so I attached the existing databases (looking at existing .mdf files), and everything returned to its normal state.

After fixing everything, I created a maintenance plan for a weekly backup of everything, including the main database .

In my particular case, this problem was caused by the fact that bad sectors appeared on the Seagate hard drive a couple of months after the expiration of the 2-year warranty period. Most of the Seagate drives I've ever had have run out either before or shortly after the warranty - so now I avoid Seagate like the plague !!

+5
source

I recently had the same error. I checked the My Server Instance Log folder.

 x:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log\ 

and I found these errors in the logs

 Starting up database 'master'. Error: 17204, Severity: 16, State: 1. FCB::Open failed: Could not open file x:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\master.mdf for file number 1. OS error: 5(Access is denied.). Error: 5120, Severity: 16, State: 101. Unable to open the physical file "E:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\master.mdf". Operating system error 5: "5(Access is denied.)". Error: 17204, Severity: 16, State: 1. FCB::Open failed: Could not open file E:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\mastlog.ldf for file number 2. OS error: 5(Access is denied.). Error: 5120, Severity: 16, State: 101. Unable to open the physical file "E:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\mastlog.ldf". Operating system error 5: "5(Access is denied.)". SQL Server shutdown has been initiated 

So for me it was easy to fix. I just added the correct permissions for these files to the sql server service account. I hope this helps

+3
source

What is a system event log?

You tried to repair: Sql server installation center β†’ Maintenance β†’ Repair

enter image description here

+2
source

This usually happens when master.mdf or mastlog.ldf gets corrupted. To solve the goto problem, use the following path C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL , you will find the "Template Data" folder, copy the master.mdf file and mastlog.ldf and replace it with C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Data folder . This is it. Now start the MS SQL service and you are done

+1
source

Check out the event viewer, it often gives you an idea of ​​the source of the problem:

enter image description here

+1
source

In my case, I had to upgrade SQL Server because the trial license has expired.

enter image description here

+1
source

I got this error today. And the above answers did not help me. I was getting this error when trying to start the SQL Server service (SQLEXPRESS) in services (services.msc).

When I checked the error log in the location C: \ Program Files \ Microsoft SQL Server \ MSSQL13.SQLEXPRESS \ MSSQL \ Log, the port associated with TCP / IP was detected.

2018-06-19 20: 41: 52.20 spid12s Initialization TDSSNIClient failed with error 0x271d, status code 0xa. Reason: Failed to initialize the TCP / IP listener. An attempt was made to access the socket in a manner prohibited by its access rights.

I recently ran an MSSQLEXPRESS image in my dock container that used the same TCP / IP port that caused this problem.

enter image description here

So, I just dropped my TCP / IP by running the following command.

netsh int ip reset resetlog.txt

enter image description here

After the reset was completed, I had to restart the computer, and when I try to start the SQLEXPRESS service again, it started successfully. Hope it helps.

+1
source

Make sure that both disks have the same partition (for example, FAT or NTFS, preferably NTFS), also make sure that it has a NETWORK SERVICE account, has access.

0
source

Database recovery fixed this for me as well. It was also necessary to restore the old database from the backup, because it was damaged during a power outage ... The copy master.mdf procedure did not work for me.

0
source

I had the same problem before

error code 3417: SQL SERVER cannot start the main database, without master db SQL SERVER cannot start MSSQLSERVER_3417

The main database logs all the information at the system level for the SQL Server system. This includes instance metadata, such as logon accounts, endpoints, linked servers, and system configuration settings. In SQL Server, system objects are no longer stored in the main database; instead, they are stored in a resource database. In addition, master is a database that records the presence of all other databases and the location of these database files and records initialization information for SQL Server. Therefore, SQL Server cannot start if the main database is not accessible by MSDN Master DB , so you need to reconfigure all settings after master db is restored

solutions

  • replace master mdf and ldf files with the same files from another instance of sql Server, if its version
  • Restore refrence system databases
  • reinstall sql server
0
source

I copied master.mdf and mastlog.ldf from another computer (fortunately, we have many clients with the same configuration, otherwise, the template data may be needed). I copied the damaged master.mdf and mastlog.mdf. After that, I replaced the bad ones from another computer. And it worked. Of course, I needed to start the MSSQLSERVER Service. But after that I had a problem that the user already exists, but was orphaned (error code 15023), I fulfilled the request

USE EXEC database_name sp_change_users_login 'Auto_Fix', 'username'

after that, everything worked smoothly. Hope this helps you and thanks a lot for this topic, saved me :)

0
source

Just rename the current ErrorLog to any other name, for example Errorlog _Old, and change any old log file to the error log file

try starting the SQL server services .. This. he will work.

Sql server error log file is corrupt. therefore it gives the problem, even if you have all the permissions .. when you delete it. a new file will be created.

0
source

I ran into this problem after changing the location of the database. And I solved this by moving the system databases back to their default location. Although I recommend not moving system databases, such as master and model, to another location. But if you want, you can refer to this article: https://docs.microsoft.com/en-us/sql/relational-databases/databases/move-system-databases?view=sql-server-2017.

0
source

All Articles