Share via

error 26 trying to connect to my local server

Chau Nguyen (CELA) 0 Reputation points Microsoft Employee
2026-03-06T18:06:48.76+00:00

Cannot connect to xxx.xxx.xxx.xxx\SQLEXPRESS.

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)

SQL Server | Other

Answer recommended by moderator
  1. Erland Sommarskog 133.6K Reputation points MVP Volunteer Moderator
    2026-03-06T21:31:18.7933333+00:00

    The error message means that you were not able to reach the SQL Server instance you tried to reach. There can be several reasons for this:

    • SQL Server is not running - check in the SQL Server Configuration Manager.
    • Instance name is wrong. Again, you can use SQL Server Configuration Manager to check what the instance name is. Note that if the name is MSSQLSERVER this is a default instance, and you should not specify an instance name at all.
    • The server name is wrong. It seems from your post, that you have specified an IP address. At the same time, you talk about your local server. In that case, there is little point to use an IP-address. Simply say .\SQLEXPRESS.
    • If you are in fact trying to connect to an SQL Server instance on a different machine, there can be complications with firewalls, the Browser service and whether the instance accept remote connections.

    It would helped if you had clarified why you think connection should succeed and what troubleshooting you have conducted on your own.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2026-03-06T18:07:06.33+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Error 26 indicates that the client cannot locate the specified SQL Server/instance. For a local SQLEXPRESS instance, use the following checks and fixes:

    1. Verify the instance name and connection string
      • For a default SQL Express install on the local machine, the instance is typically MACHINENAME\SQLEXPRESS.
      • When connecting locally from SSMS, try:
        • localhost\SQLEXPRESS
        • .`SQLEXPRESS`
        • <YourMachineName>\SQLEXPRESS
      • Avoid using an IP with \SQLEXPRESS unless that instance is actually listening on that IP and SQL Browser is reachable.
      • Ensure the server name in the connection string exactly matches the actual instance name.
    2. Confirm SQL Server is installed and running
      • Open SQL Server Configuration Manager or Services.msc.
      • Locate SQL Server (SQLEXPRESS) and ensure its status is Running.
      • If only SQL Server Management Studio (SSMS) is installed and no SQL Server instance, install SQL Server Express or another SQL Server edition first.
    3. Enable TCP/IP (and Named Pipes if needed)
      • In SQL Server Configuration ManagerSQL Server Network ConfigurationProtocols for SQLEXPRESS:
        • Ensure TCP/IP is Enabled.
        • Optionally enable Named Pipes.
      • Restart the SQL Server (SQLEXPRESS) service after changes.
    4. Check client protocols and protocol order
      • On the client machine (even if same machine), open SQL Server Configuration ManagerSQL Native Client <version> ConfigurationClient Protocols.
      • Ensure TCP/IP is enabled.
      • Ensure protocol order has Shared Memory as 1 (for local) and TCP/IP before Named Pipes.
    5. Test TCP/IP connectivity and name resolution
      • From the client machine, test basic connectivity:
        • ping <IP address>
        • ping <ComputerName>
      • If ping by IP works but ping by name fails, name resolution is not configured correctly. In that case, connect using the IP address directly (for example, <IP>,<port>), then fix name resolution later.
    6. Verify firewall configuration and port
      • Determine the TCP port used by SQLEXPRESS (via SQL Server Configuration Manager or SQL Server error log).
      • If using the default port 1433 for a default instance, ensure firewalls allow traffic on 1433.
      • If using a non-standard port, connect using <ServerName>,<Port> (for example, localhost,2000) and:
        • If this works, update the application/SSMS connection string to include the port.
        • If it fails, the firewall is likely blocking that port; configure the firewall to allow it.
    7. Check for incorrect aliases
      • Run cliconfg.exe (SQL Server Client Network Utility) or use SQL Server Configuration Manager → SQL Native Client <version> ConfigurationAliases.
      • Look for an alias matching the name used in the connection.
      • Temporarily rename the alias (for example, MySQLMySQL_test) and retry the connection:
        • If it then works, the alias was incorrect or stale.
        • If not, restore the original alias name and verify:
          • Correct server name or IP.
          • Correct port.
          • Correct pipe name format if using Named Pipes.
    8. Login timeout / repeated failures
      • If the error is accompanied by “Login timeout expired,” it confirms the client cannot reach the instance within the timeout. After completing the steps above (instance running, protocols enabled, firewall open, correct name/port), retry the connection.

    These steps address the typical causes of error 26 for a local SQLEXPRESS instance: wrong server/instance name, SQL Server not running, disabled TCP/IP, blocked ports, or misconfigured aliases.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.