When you connect to SQL Server 2005, this failure may be caused by SQL Server not allowing remote connections under the default settings. (provider: Named pipe provider, error:40-cannot open a connection to SQL Server)

Source: Internet
Author: User
Tags interface microsoft sql server microsoft sql server 2005 connect mssqlserver
error|server| Program

Error : "When connecting to SQL Server 2005, the default setting for SQL Server to disallow remote connections may cause this failure. (provider: Named pipe provider, error:40-cannot open a connection to SQL Server) ",

These errors I encountered in two situations, one that pops up when you open open SQL Server 2005, and the other occurs when the application connects to SQL Server 2005. Summed up, for several reasons:

1. The database engine did not start.

There are two ways to start:

(1) Start-> program->microsoft SQL Server 2005->SQL Server 2005 peripheral configuration, click on the "Perimeter of Service Connection Configuration" in an open interface, and locate the database in an open interface Engine, click Services, see if it is started on the right, or click "Start" if it is not started, and make sure the "Startup Type" is automatic, not manual, otherwise start manually on the next boot;

(2) Open: Start-> program Microsoft SQL Server 2005-> Configuration Tool->sql Server Configuration Manager, select SQL Server 2005 Services MSSQLSERVER), and click the "Start Service" button in the toolbar to change the service status to start;

When you use both of these methods, sometimes you may get an error at startup, and you will need to see if via is enabled in the SQL Server 2005 Network Configuration->mssqlserver protocol in SQL Server 2005 Configuration Manager. If enabled, disable it. And then do one of these things.

2. Remote connections are allowed when remote connections are made.

SQL Server 2005 is restricted to local connections by default. We can manually enable remote connections. In the first of the above, locate the database Engine, click Remote Connections, and on the right, change local Area Connection (L) to local and remote connections (R) and select "Use both TCP/IP and Named Pipes (B)."

3. If it is a remote connection, you will also want to see if the statement connecting the database is correct, whether the login account is correct, the password is correct, and so on.

When I connect to a database in a local area network, because of the connection string out of the question, in a local area network of a machine connected to another computer database, the server= equipped with the database of another computer IP. I always have the error when I connect to the database, and after a long time, I found that IP is not correctly uploaded to the connection string, originally I was connected, using the local, that is, 127.0.0.1, the input of the IP did not pass to the connection string.

These are some of the cases I have summed up, I hope to be able to meet similar problems with friends to provide some help and reference.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.