Cannot connect anymore to local SQL Server 2008 da

2020-04-18 09:19发布

Today I went to connect to my local database but I cannot connect anymore for unknown reasons. I typed in (local) and used Windows authentication like I always do yet I get this error.

Cannot connect to localhost.

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) (.Net SqlClient Data Provider)

3条回答
神经病院院长
2楼-- · 2020-04-18 09:28

I just experienced the same problem. My database is stored on an external hard disk, unfortunately I plugged it in after I started the computer.

I had to restart the computer, to connect again successfully. A logout was not enough.

查看更多
劳资没心,怎么记你
3楼-- · 2020-04-18 09:45

Is the SQL Server service running? To check, right-click on "My Computer" and choose "Manage..." From the tree on the left side of the window, choose "Services and Applications", then "Services". Look for the "SQL Server" service and see if it is in the "Started" status. If not, right-click on the service and choose "Start".

查看更多
萌系小妹纸
4楼-- · 2020-04-18 09:47

You may also want to check that the service is set to automatic start. this way when you reboot, you won't have to start the service...

查看更多
登录 后发表回答