Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'?

I can't seem to connect to my database from a site. I get this error:

Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

I tried using the local IP address to connect as well as a public one. I've tried:

  1. Yes, the site can communicate with the server
  2. Named pipes/TCP is enabled.
  3. Remote connections are allowed.
  4. Windows Firewall is off
  5. Created an exception for port 1433 in Windows Firewall.
  6. Enabled everything in SQL Server Configuration Manager.

What else can I do here?

like image 323
Damien Avatar asked Mar 30 '12 14:03

Damien


People also ask

Can't connect to SQL Server Named Pipes Provider?

Check the TCP/IP and Named Pipes protocols and port. Open SQL Server Configuration Manager and check the SQL Server Network Configuration protocols. You should enable Named Pipes and TCP/IP protocol. For the TCP/IP protocol, right click and select properties to check the TCP/IP communication port as well.

How do I enable Named Pipes in SQL Server?

Make sure that the State of both SQL Server and SQL Server Browser is Running and that Start mode is set to Automatic. From the navigation tree on the left, select SQL Server Network Configuration and select the current instance. Right-click the protocol Named Pipes and click Enabled.


1 Answers

Solving this problem is very easy:

  1. Go to control panel.
  2. search for services.
  3. Open Local services window from your search results
  4. Restart your MSSQLSERVER service.

Screenshot of the steps:

Screenshot of the steps

like image 79
Kazem Avatar answered Sep 25 '22 19:09

Kazem