Home | Contact | Index | SenSource, Inc.
Guides | How To | Errors | Troubleshoot | FAQ | Glossary Search Start Searching...
Home > Home > Errors > SQL Server 2005: Cannot Connect to Remote Server

SQL Server 2005: Cannot Connect to Remote Server

Last Updated: 3/31/2010 2:34:34 PM

Symptom
When you try to connect to an instance of Microsoft SQL Server 2005 from a remote computer, you may receive one of the following error messages:
"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connection. (provider: SQL Network Interfaces, error 28 - Server doesn't support request protocol) (Microsoft SQL Server)"
"Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection. (Microsoft: SQL Server. Error: 18452)"
 
Possible Causes
  1. This problem may occur when SQL Server 2005 is not configured to accept remote connections. By default, SQL Server 2005 Express Edition and SQL Server 2005 Developer Edition do not allow remote connections.
  2. Windows Firewall on Windows Server 2005 helps prevent unauthorized access to computer resources. However, if the firewall is configured incorrectly, attempts to connect to an instance of SQL Server may be blocked. To access an instance of SQL Server that is behind the firewall, you must configure the firewall on the computer that is running SQL Server.
 
Resolution
» Enabling Remote Connections
  • Verify that both SQL Server and Windows Authentication modes are enabled.
    1. Log into SQL Server Management Studio Express on local SQL Server with Windows Authentication user.
    2. In Object Explorer, right-click on the instance name and select Properties.
    3. On the left, select Security and change Server Authentication to SQL Server and Windows Authentication and click OK.
    4. A pop-up will appear advising that SQL Server must be restarted for the changes to take effect. Click OK.
    5. In Object Explorer, right-click on the instance name and select Restart.
    6. Click Yes at the verification pop-up.
    7. Wait for the service to stop and start.
  • Verify that remote connections are enabled in SQL Server Surface Area Configuration.
    1. Open SQL Server Surface Area Configuration.
    2. Under Configure Surface Area for [computername], select Surface Area Configuration for Services and Connections.
    3. On the left side, expand your SQL Service Instance » Database Engine » Remote Connections.
    4. On the right side, select Local and Remote Connections and Using Both TCP/IP and Named Pipes.
    5. On the left side, expand SQL Server Browser » Service.
    6. On the right side, if the startup type is Disabled, change it to Automatic, click Apply, and then click Start to initiate the service. Click OK.
  • Check whether the problem is fixed by trying to access the instance of SQL Server from another computer. If the problem is not fixed, proceed to Configuring Windows Firewall.
» Configuring Windows Firewall SQL Server 2005 uses an instance ID as part of the path when you install its program files. To create an exception for each instance of SQL Server, you must identify the correct instance ID. To obtain an instance ID, follow these steps:
    Step 1
  1. Click Start, point to Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Configuration Manager.
  2. In SQL Server Configuration Manager, click the SQL Server Browser service in the right pane, right-click the instance name in the main window, and then click Properties.
  3. On the SQL Server Browser Properties page, click the Advanced tab, locate the instance ID in the property list, and then click OK.
    Step 2
  1. To open Windows Firewall, click Start, click Run, type firewall.cpl, and then click OK.
  2. In Windows Firewall, click the Exceptions tab, and then click Add Program.
  3. In the Add a Program window, click Browse.
  4. Click the C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe executable program, click Open, and then click OK.
    • Note: The path may be different depending on where SQL Server 2005 is installed. MSSQL.1 is a placeholder for the instance ID that you obtained in step 3 of the previous procedure.
    • Repeat 1-3 for each instance of SQL Server 2005 that needs an exception.
  5. From the Exceptions tab, click Add Program again.
  6. In the Add a Program window, click Browse.
  7. Click the C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe executable program, click Open, and then click OK.
    • Note: The path may be different depending on where SQL Server 2005 is installed.
  8. From the Exceptions tab, click Add Port.
  9. In the Add a Port window, enter SQL Port 1433 for the Name.
  10. Enter 1433 for the Port Number.
  11. If not already checked, select the radio for TCP and then click OK.
  12. From the Exceptions tab, click Add Port.
  13. In the Add a Port window, enter SQL Port 1434 for the Name.
  14. Enter 1434 for the Port Number.
  15. If not already checked, select the radio for TCP and then click OK.
  • Check whether the problem is fixed by trying to access the instance of SQL Server from another computer. If the problem is not fixed, contact support.
 
Guides | How To | Errors | Troubleshoot | FAQ | Glossary | Contact | Index | SenSource, Inc.
© 2010 SenSource, Inc. All Rights Reserved. 3890 Oakwood Ave. Youngstown, OH 44515