How to fix Error 9693 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 9693 — Endpoint Cannot Listen for Connections

Why This Error Happens

Error 9693 occurs when a SQL Server endpoint (typically TCP, Database Mirroring, or Service Broker) fails to bind to its configured port during startup. This is most commonly caused by another process or SQL Server instance already occupying the specified port, insufficient permissions for the SQL Server service account to bind to the network interface, or a conflicting firewall/network configuration on Windows Server 2025. In some cases, a corrupted or misconfigured endpoint definition in the system catalog can also trigger this failure.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Port or Process

  • Open Command Prompt as Administrator and run netstat -ano | findstr <port_number> (e.g., 5022 for mirroring, 1433 for default TCP).
  • Note the PID returned and cross-reference it in Task Manager under the “Details” tab.
  • Check SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the exact port and error text referenced in the %.*ls message.

Step 2: Verify and Correct Endpoint Configuration

  • Open SQL Server Management Studio (SSMS) and run:
  SELECT name, port, state_desc FROM sys.tcp_endpoints;
  • If the port is incorrect or duplicated, alter the endpoint:
  ALTER ENDPOINT [Mirroring] STATE = STARTED AS TCP (LISTENER_PORT = 5023);
  • Ensure no other SQL instance or application (like IIS or another database engine) is bound to the same port.

Step 3: Check Service Account Permissions and Firewall Rules

  • Confirm the SQL Server service account has “Log on as a service” rights via secpol.msc > Local Policies > User Rights Assignment.
  • Open Windows Defender Firewall with Advanced Security and verify an inbound rule exists for the SQL Server port:
  New-NetFirewallRule -DisplayName "SQL Server Endpoint" -Direction Inbound -Protocol TCP -LocalPort 5022 -Action Allow
  • Restart the SQL Server service via services.msc or PowerShell:
  Restart-Service -Name "MSSQLSERVER" -Force

Step 4: Rebuild or Recreate the Endpoint (If Corrupted)

  • If the endpoint metadata is corrupted, drop and recreate it:
  DROP ENDPOINT [Mirroring];
  CREATE ENDPOINT [Mirroring]
  STATE = STARTED
  AS TCP (LISTENER_PORT = 5022)
  FOR DATABASE_MIRRORING (ROLE = ALL);
  • Restart the SQL Server service and monitor the ERRORLOG for successful endpoint initialization.

Alternative or Verification Steps

  • Run SELECT * FROM sys.dm_tcp_listener_states; to confirm the endpoint is in a “Ready” state with the correct IP and port bound.
  • If the issue persists, temporarily disable third-party antivirus/firewall software to rule out network-layer interference, then re-test connectivity using Test-NetConnection -ComputerName localhost -Port 5022.