CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • error: 26 - Error Locating Server/Instance Specified The server was not found or was not accessible

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    160
  • Date Created
    Tuesday, January 10, 2012
  • Last Updated
    Friday, July 9, 2021
  • This Article Has been Viewed
    2086 times
  • Short Desc
    If you do not have the proper Firewall settings for SQL Server, you will receive the following error, provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified
  • Details
    Firewall settings must be set in your SQL Server instance for remote access or connectivity from a web or other type of application.
    If these settings are not applied to your Server, you will get the following error.


     
    TITLE: Connect to Server
    ------------------------------

    Cannot connect to server-name\instance-name.

    ------------------------------
    ADDITIONAL INFORMATION:

    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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

  • Recreate Issue
    Without proper firewall settings enabled, no one will access the SQL server instance from within your network. This includes web and application-based programs.
  • Resolve Issue
    (This article has been updated with more accurate information)
    Add the following Firewall setting to your SQL Server instance.

    Open a [command prompt].
    [Copy and paste] the following.


    New-NetFirewallRule -DisplayName "SQLServer default instance" -Direction Inbound -LocalPort 1433 -Protocol TCP -Action Allow
    New-NetFirewallRule -DisplayName "SQLServer Browser service" -Direction Inbound -LocalPort 1434 -Protocol UDP -Action Allow
    New-NetFirewallRule -DisplayName "SQLServer Listener instance" -Direction Inbound -LocalPort 2433 -Protocol TCP -Action Allow
    New-NetFirewallRule -DisplayName "SQL Server AlwaysOn Availability Group" -LocalPort 5022 -Direction Inbound -Protocol TCP -Action Allow
    netsh advfirewall firewall add rule name="SQLServer Browser" dir=in action=allow program="C:\Program Files (x86)\Microsoft SQL Server\90\Shared\sqlbrowser.exe" enable=yes
    netsh advfirewall firewall add rule name="SQLServer Service" dir=in action=allow program="D:\SQLInstance\MSSQL15.SQL2019\mssql\binn\sqlserver.exe" enable=yes


    Restart SQL Server instance.
    (--Desktop Expereince--)
    [Control Panel].
    [Administrative Tools]
    [Services]

    Right click on [SQL Server (InstanceName)]
    Choose [Restart]

    (--Server Core--)
    Connect to your windows Core Server from another computer on the network.

    [Right-click] on [Start Menu]
    Choose [Computer Management]
    --Window opens
    Right Click on [Computer Management]
    Type in the name or your Server Server name (SQLCore)
    Press [Enter]
    --When page loads. From left side TreeView
    Expand [Services and Applications]
    Click on [Services]
    Scroll down to [SQL Server SQLCore)]
    [Right-click] and choose [Restart]