10

I've bought my first VPS yesterday, and I have installed Microsoft SQL Server 2012 Express on it.

Then I have restarted my VPS. But SQL Server Service didn't start. I've tried to start it manually, but It can't start:

SQL Server service doesn't start

What is the problem? How to solve it?

P.S: This is my first server management, and I'm a newbie, if you need any further details about this, please leave a comment. I'll update the question.

Update 1: This is some log details from Event viewer that I thought that they may be useful for this problem:

FCB::Open failed: Could not open file e:\sql11_main_t.obj.x86release\sql\mkmastr\databases\objfre\i386\MSDBData.mdf for file number 1. OS error: 3(The system cannot find the path specified.).

The resource database build version is 11.00.3000. This is an informational message only. No user action is required.

FileMgr::StartLogFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'e:\sql11_main_t.obj.x86release\sql\mkmastr\databases\objfre\i386\MSDBLog.ldf'. Diagnose and correct the operating system error, and retry the operation.

Starting up database 'model'.

FCB::Open failed: Could not open file e:\sql11_main_t.obj.x86release\sql\mkmastr\databases\objfre\i386\model.mdf for file number 1. OS error: 3(The system cannot find the path specified.).

FileMgr::StartLogFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'e:\sql11_main_t.obj.x86release\sql\mkmastr\databases\objfre\i386\modellog.ldf'. Diagnose and correct the operating system error, and retry the operation.

I'm confused about these e:\s, my VPS has just one C:\ drive, So what is e:\ ?

Mahdi Ghiasi
  • 341
  • 2
  • 4
  • 15

1 Answers1

17

There a few topics on it, but someone posted a good workaround here

NET START MSSQL$SQLEXPRESS /f /T3608

SQLCMD -S .\SQLEXPRESS

1>SELECT name, physical_name, state_desc FROM sys.master_files ORDER BY database_id;

Now notice those wrong file names; and run following commands ...

Note: you need to change the file name location ..

1>ALTER DATABASE model MODIFY FILE ( NAME = modeldev, FILENAME = 'c:\model.mdf');
2>ALTER DATABASE model MODIFY FILE ( NAME = modellog, FILENAME = 'c:\modellog.ldf');
3> go

ALTER DATABASE msdb MODIFY FILE ( NAME = MSDBData, FILENAME = 'c:\MSDBData.mdf');
ALTER DATABASE msdb MODIFY FILE ( NAME = MSDBLog, FILENAME = 'c:\MSDBLog.ldf');

ALTER DATABASE tempdb MODIFY FILE ( NAME = tempdev, FILENAME = 'c:\temp.mdf');
ALTER DATABASE tempdb MODIFY FILE ( NAME = templog, FILENAME = 'c:\temp.ldf');

go

exit;

NET STOP MSSQL$SQLEXPRESS 
Sc0rian
  • 1,011
  • 7
  • 16
  • After running those commands, Now I'm getting these errors (in Event Viewer): `Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'c:\modellog.ldf'. Diagnose and correct the operating system error, and retry the operation.` How to **create** those `*.mdf`, `*.ldf` files? – Mahdi Ghiasi Nov 12 '12 at 18:40
  • There was `model, modellog, MSDBData and MSDBLog` files in `C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA`. Now the problem is solved. Thank you very much! – Mahdi Ghiasi Nov 12 '12 at 19:09
  • remmeber to enter "Go " in second line after first query to execute it – Iman Nov 26 '15 at 09:31
  • for me for some reason MSSQL12.SQLEXPRESS or SQL 2014 LocalDB express was replaced instead of old MSSQL11.SQLEXPRESS path – Iman Nov 26 '15 at 09:37
  • I worked at this for a very long time, and couldn't get it right, basically I could start SQL with the first part, but after that SQLCMD couldn't connect using windows authentication. And if I used MSSMS the db engined tried to load it's resources db at that same bad location. My solution was to simply give the engine what it wants... created a RamDisk and that path and copied the system dbs to that location. Now I can use MSSMS and set the paths to the correct values. – Wasted_Coder Jan 16 '21 at 07:17