While it is not recommended (mostly due to security reasons), SQL can be run on a Domain Controller. But the following 2 points have to be considered:
- The order is important: SQL can be installed on a DC. But a SQL server cannot be made a DC. So: DC first, then SQL
- You cannot use the following 3 accounts for the SQL service:
Local Service, Network Service, MSSQL$SQLEXPRESS
Although I used these guidelines, it did not work for me. Near the end of the install, when the SQL service is started for the first time, I got these log entries:
Log Name: Application
Source: MSSQL$SQLEXPRESS
Date: 21.09.2015 13:50:56
Event ID: 17207
Task Category: Server
Level: Error
Keywords: ClassicFileMgr::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.
The installation stopped. Most solutions on the web suggested to uninstall and try with another account, but that didn't work for me. Here is how I got it to work:
- Make sure that the stopped "SQL Server (SQLEXPRESS)" service is running under the "Local System" account
- Open a cmd box and start the service with
NET START MSSQL$SQLEXPRESS /f /T3608
(Yes, it will start!) - Start SQLCMD with:
SQLCMD -S .\SQLEXPRESS
- Issue the following SQL commands, you will see some wrong file paths:
SELECT name, physical_name, state_desc FROM sys.master_files ORDER BY database_id;
go - Now correct these paths in the DB:
ALTER DATABASE model MODIFY FILE ( NAME = modeldev, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\model.mdf');ALTER DATABASE model MODIFY FILE ( NAME = modellog, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\modellog.ldf');ALTER DATABASE msdb MODIFY FILE ( NAME = MSDBData, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\MSDBData.mdf');ALTER DATABASE msdb MODIFY FILE ( NAME = MSDBLog, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\MSDBLog.ldf');ALTER DATABASE tempdb MODIFY FILE ( NAME = tempdev, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\temp.mdf');ALTER DATABASE tempdb MODIFY FILE ( NAME = templog, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\temp.ldf');
go - Exit the SQLCMD:
exit
- Stop the SQL service:
NET STOP MSSQL$SQLEXPRESS
- Start the SQL service normally. It will now start and do the initialisation of the tables, this might take a bit longer.
- In SQL Configuration Manager, make sure that all protocols are active:
SQL Server Network Configuration > Protocols for SQLEXPRESS > Shared Memory, Named Pipes and TCP/IP = enabled
So now your DB instance is ready, but there is one problem, there are no valid users (except the sa account) in it, so you can't login and use it.
To sort this problem, go to my post here.
This post is straight to the point and I was able to get SQL Server 2017 Express installed and running on a DC. Update the paths that point to MSSQL11.SQLEXPRESS to MSSQL14.SQLEXPRESS for SQL Server 2017. Follow the link at the end to enable the sa login and update the password. Many thanks.
Wow.... Thank you very much, it worked perfectly just as you described it. Running the SQL on a DC is just for some dev purpose and I would not do it in a producction environment. I used SQL SERVER EXPRESS 2017 ...but the procedure still works only a different PATH....Also had to reset the sa password to get in.
So Kudos, thumbs etc for you
Thanks! I confirm your how-to is also valid for SQL Server 2014 Express on Windows 2012 R2 Domain Controller. Just have to replace MSSQL11.SQLEXPRESS with MSSQL12.SQLEXPRESS in the file path.
Finally, no discussions to NOT install SQL on a DC and, guess what: This mini-Howto just works perfectly and you just saved my day!
*Thumbsup
This worked perfectly. I was installing SQL Server express 2012 onto Windows Server 2012 Essentials which comes pre configured as a domain server.
The install was difficult and failed. However following these sterps allowed me to get up and running.