Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What may be the reason why SQL Server not running in services?

Tags:

sql-server

What can I do with this I have an error on running the SQL Server Express service

Windows could not start the SQL Server on local computer...

EDIT:

By the way I have looked at the event log and I found this

The log scan number (85:368:1) passed to log scan in database 'model' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during start up.

EDIT II:

I did all suggestions but it still not running(sql express server service) can anyone help me to do this?

like image 743
pretty me Avatar asked Dec 22 '15 10:12

pretty me


People also ask

Why SQL services are not running?

A service could have been running previously with an invalid account or password. If the Database engine service will not start, after checking service credentials and startup, check the ERRORLOG. The ERRORLOG can be located at C:\Program Files\Microsoft SQL Server\<Instance ID>\MSSQL\LOG .

How do I enable SQL Server services?

Click Start, click Run, type Services. msc, and then click OK. In Services, locate the MSSQL$(InstanceName) instance in the Name column. Note InstanceName is a placeholder for the name that the instance of SQL Server was given when it was installed.

What to Do If SQL Server is not responding?

You can kill SQL Server with "KILL sqlservr.exe". The KILL command is in the NT resource kit. It can then be started with NET START MSSQLSERVER. ONLY do this if SQL Server does not respond to a normal shutdown or NET STOP MSSQLSERVER command.


3 Answers

To those who has the same problem as mine try doing this. here are the things that i have done just to solve this:

First: Go to this path C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\Binn\Templates

Second: Copy and paste the database/file named model.mdf and modellog.ldf to this path C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA

That's it.. Thanks to those who answers my question..

like image 189
pretty me Avatar answered Feb 01 '23 23:02

pretty me


If you use the regular MSSQL 12 (instead of SQLExpress) follow the instructions below:

  1. Go to folder C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\Templates
  2. Copy the template database files model and modellog to folder C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA
  3. Restart the SQL Server (MSSQLSERVER) in Services control panel
  4. To verify the fix, connect to database engine using Microsoft SQL Management Studio
like image 21
Fuji Nguyen Avatar answered Feb 01 '23 23:02

Fuji Nguyen


You have to rebuild the Database : 'model'. The simpliest way is to copy this 2 files model.mdf and modellog.ldf from a working instance.

You can also use this command to rebuild system database Setup QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=InstanceName /SQLSYSADMINACCOUNTS=accounts [/ SAPWD= StrongPassword ] [ /SQLCOLLATION=CollationName] See here

like image 42
Polux2 Avatar answered Feb 01 '23 23:02

Polux2