SQL & non-default ports

Personally, I’m a fan of running SQL Server on non-default ports. One of the reasons is that it prevents login failed messages in the log if they don’t have access and don’t know the port number. A network engineer also told me once that they preferred this too as a way of troubleshooting network problems – I cant speak for the validity of that.

Microsoft has documented an article on the port range to use when using non-default ports…

Click here to view Microsoft article.

For a detailed list of all ports used by SQL Server, click here.

This Microsoft article details on how to setup SQL server to listen on a non-default TCP port – Click here.

The standard port for a HADR endpoint as used in the setup of AG’s is 5022. Ports in the user-defined range (49152 – 65535) is not supported.

If you are using non-default ports, remember to make sure that the SPN is setup correctly. Unless you have the permissions, a domain administrator needs to do this if SQL server doesn’t have the permissions. To check, simply run this command in CMD or Powershell:

SETSPN -L <domain\sql service account>

e.g. SETSPN -L CORP\sql_service