2

Problem statement

I have installed SQL Server, but when I try to run: net start MSSQLSERVER on the command line, I get this error:

The service name is invalid. More help is available by typing NET HELPMSG 2185

Note: proof that I installed SQL Server: https://gyazo.com/a0140b3da72feee8152d84042eee24c3

What I've tried

Stack overflow:

DB Admin:

Other:

Also, I tried using sc sdshow MSSQLSERVER in both CMD and PowerShell (run and not run as Admin) but it fails because of this:

[SC] OpenService FAILED 1060: The specified service does not exist as an installed service

I know that I didn't rename the server to something else because I was never presented with the option to do so.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Compiler v2
  • 3,509
  • 10
  • 31
  • 55
  • 2
    You probably have a named instance rather than a default instance. Open the “SQL Server Configuration Manager” program and see what’s listed under “Servers”. Also, what do you see in services.msc? – Dai Jul 13 '20 at 22:00
  • SQL Server Express will install a named instance by default btw. Which editing do you have installed? – Dai Jul 13 '20 at 22:02
  • @Dai I have installed the Developer version. And don't see SQL server under `services.msc` but only SQL Server Writer. – Compiler v2 Jul 13 '20 at 22:05
  • 1
    Sounds like your installation failed - or you didn’t select the database engine when you installed it. Re-run the installer. – Dai Jul 13 '20 at 22:06
  • Is it possible that you installed LocalDB instead of the real SQL Server? That doesn't runs the DB engine as a service, but as a normal user program. – Alejandro Jul 13 '20 at 22:08
  • Acutally it is possible you just did not select and service in the install and just installed the common components - but not the db services. – TomTom Jul 13 '20 at 22:15
  • @Dai I reran the installer, and it worked! I have started the server successfully. Please post your answer to my question. – Compiler v2 Jul 13 '20 at 22:16
  • It says, question does not meet Stack Overflow guidelines (?). Never mind, **it is very much valid and relevant question**. Thanks for asking. – Atul Nov 28 '22 at 18:05
  • 1
    @Atul Questions like this should be asked on https://dba.stackexchange.com/, not here. – Mark Rotteveel Nov 29 '22 at 09:23

1 Answers1

2

(Reposting my comment as an answer):

It sounds like your installation failed - or you didn’t select the database engine when you installed it. Re-run the installer.

You can review the installer setup logs to see if and why it failed: https://learn.microsoft.com/en-us/sql/database-engine/install-windows/view-and-read-sql-server-setup-log-files?view=sql-server-ver15

Look at %programfiles%\Microsoft SQL Server\nnn\Setup Bootstrap\Log\Summary.txt.

Dai
  • 141,631
  • 28
  • 261
  • 374
  • I ran installation wizard again quickly, then I launched "SQL Server Configuration Manager" and I restarted MSSQLSERVER service. Then it started showing service in Services. Now I tried to connect using "127.0.0.1" in Microsoft Management Studio but it didn't connect. Then I used "localhost" and it connected. That was Microsoft! Many thanks for all your hints. – Atul Nov 28 '22 at 18:03