1

When I have tried to connect to localhost and it was displayed the message about

"mssql:Error 2: A network-related or instance-specific error occurred while establishing a connection to SQL Server.The server was not found or was not accessible.Verify that the instance name is correct and that SQL Server is configured to allow remote connections.(provider:Named Pipes Provider,error 40-Could not open a connection to SQL Server)".

How can I fix it?

I have tried to follow the solution technique given by "Why am I getting "Cannot Connect to Server - A network-related or instance-specific error"?" but i can't find the location of vscode mssql extension configuration tool and SQL Server Configuration Manager?

Suraj Kumar
  • 5,547
  • 8
  • 20
  • 42
kbk
  • 11
  • 4

1 Answers1

1

You may be changed your computer name. if you changed your computer name then back to set initial name of computer. Then restart your Sql Server(MSSQLSERVER)service.

  • E.G. : in SQL Server Configuration Manager choose SQL Server Services and try to find line with name "SQL Server" and check name of server in parentheses (for me: SQLEXPRESS). Next, in window "Connect to Server" in "Server name" click on arrow and find name like: \. Also SQL Server should running. – Chusya Aug 22 '22 at 13:40