SQL 2005 does not allow remote connections may cause this failure workaround _mssql2005

Source: Internet
Author: User
Tags configuration settings microsoft sql server microsoft sql server 2005 mssql mssqlserver

(provider: Named pipe provider, error:40-cannot open a connection to SQL Server)

The database connection statement for the Web site is: server=127.0.0.1;uid=sa;pwd=xxx;database=xxx
After testing, change server=127.0.0.1 to "server=." or "server= machine name", can be normal connection;
Therefore, only when using IP can not connect, after analysis, the solution is as follows:
1. Open the SQL Server Perimeter Application configurator in the SQL Server 2005 Configuration tool and click the Peripheral application Configurator for services and connections;
2. Click "Remote Connection" in "Database Engine" in the interface, change the connection mode to "Use TCP/IP and name pipes" in "Local Connection and remote connection";
3. Restart SQL Server 2005 service via SQL Server Configuration Manager in the Configuration tool;
Note: Be sure to restart SQL Server 2005 service modifications before they take effect;

An error occurred while establishing a connection to the server. When connecting to SQL Server 2005, SQL Server does not allow remote connections under the default settings
An error occurred while establishing a connection to the server. 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)

Why. I've set his remote connection to TC/IP and Nanme in the SQL perimeter configuration settings.
And I've tried it on the internet, and I'm in the VS2005, but the meter's loaded. SQL SERVER
The problem is solved with bonus points!

Reply:
SQL Server 2005 does not allow remote connection resolution

Many students encountered this problem when they were doing the course design. Write the solution here for your reference.

The database system just installed, by default, is likely to be a remote connection times wrong, usually 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) "Search MSDN, there is a machine translation of the article, is difficult to understand, now summed up as follows:" Understand that SQL Server is a network database can be solved, simple to be divided into the following concentration.

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 Service Server (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. Whether remote connections have been allowed.

This section can be easily divided into 4 areas, namely, enabling remote connections on SQL Server, enabling SQL Server Browsing service, creating exceptions for SQL Server 2005 in Windows Firewall, and "SQLBrowser" in Windows Firewall Create an exception. Here are a few specific ways to do this, excerpted from MSDN, and personally feel that the bold part of the article should be special together with our attention.


enable remote connections on a SQL Server instance
1. Point to start-> program->microsoft SQL Server 2005-> Configuration tool->sql Server perimeter Application Configurator
2. On the SQL Server 2005 Perimeter Configuration page, click the perimeter application configurator for services and connections
3. Then click to expand Database engine, select remote connections, and on the right, select local and remote connections.
Then select the protocol you want to use, where you should enable the TCP/IP and Named Pipes service! Click Apply, and you will see the following message:
"The changes to the connection settings will not take effect until the Database engine service is restarted. ", click OK to return
4. Expand the database engine, select Services, click Stop on the right, and wait until the MSSQLServer service stops,
Then click Start to restart the MSSQLServer service.

Enable SQL Server Browser service
1. Point to start-> program->microsoft SQL Server 2005-> Configuration tool->sql Server perimeter Application Configurator
2. On the SQL Server 2005 Perimeter Configuration page, click the perimeter application configurator for services and connections
3. Then click Expand SQL Server Browser, select Services, and on the right "startup type" select "Automatic",
Click Start, and then click OK to return

Create an exception for SQL Server 2005 in Windows Firewall
1. In the Windows Firewall settings interface, select the Exceptions tab, and then click Add Program
2. In the Add Program window, click Browse
3. And then find To the C:/programfiles/microsoft files/microsoft SQL server/mssql.1/mssql/binn/

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.