A network-related or instance-specific error occurred while establishing a connection to SQL Server

When I opened SQL Sever 2014 Management Studio yesterday, the following error occurred:

 

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or could not be reached. Please verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes, error: 40 - Could not open connection to SQL Sever ) (Microsoft SQL Sever, error: 2) The system cannot find the file specified.

Since this kind of error is not the first time, it is recorded here for future reference:

 

1. Open the Sql Server Management Configurator: 

SQL Server Configuration Manager in Windows 10 is a snap-in of the Microsoft Management Console program rather than a separate program, so when running Windows 10, SQL Server Configuration Manager does not appear as an application. To open SQL Server Configuration Manager type SQLServerManager12.msc (for SQL Server 2014) or SQLServerManager11.msc (for SQL Server 2012) or SQLServerManager10.msc (for SQL Server 2008) in the Search button, or type in Run

 

The Sql server management configurator opens the rear panel as follows:

 

2. Click the Sql Server network configuration, select the MSSQLSERVER protocol, and select the TCP/IP protocol on the right page

 

3. Right-click on the TCP/IP protocol and select "Properties". You need to modify the port address for connecting to the database:

The dialog box that pops up, there are many TCP/IP ports, find "IP3", change the IP address to the IP address of your computer (or 127.0.0.1) Add 1433 to the TCP port, and then select Start

 

4. Change all ports of "IPALL" to "1433"

 

5. Restart the service 

 

6. Set the port, reopen SQL Server Management Studio, and enter: (local) or 127.0.0.1 in the server name to log in to the database.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326177708&siteId=291194637