How to check Port 1433 is working for Sql Server or not?

82,905

Solution 1

If TELNET is installed, you could use TELNET 1433 to verify port connectivity. Otherwise, the PowerShell command below can do the job using a .NET TcpClient:

$server="yourserver"; $port=1433; echo ((new-object Net.Sockets.TcpClient).Connect($server,$port)) "$server is listening on TCP port $port";

Newer versions of PowerShell include a Test-NetConnection cmdlet to facilitate testing ICMP and port connectivity. Example invocation from a Windows command prompt:

powershell -Command "Test-NetConnection -ComputerName 'yourserver' -Port 1433"

Solution 2

If the server is using TCP/IP, then the simple way is to just telnet to the SQL Server port and see if it connects. By default, that's port 1433, so this should work:

telnet servername 1433

That will probably be appropriate in most cases.

If it's using a different port, or dynamic ports (common with a named instance), then you'll need to determine which port it's currently listening on. Check SQL Server configuration manager to see if it's a specific port, or dynamic ports. If it's using dynamic ports, then as long as you don't have multiple instances on the server, netstat -abnis probably the simplest way to find what it's using. Otherwise, dig through the Windows event log or the SQL Server error log for a message indicating which port is in use by the instance.

If SQL Server is using Named Pipes, then I believe if you're able to access shares on the machine, you have adequate network connectivity. This article says you can go further and try connecting to the IPC$ share:

 net use \\servername\IPC$

That's written for SQL Server 2000, but I don't imagine this aspect has changed much, if at all.

Solution 3

You probaly want it open, since You are asking. The single most time-saving image I have found for this is here:

This is an inferred answer to the question, somewhat meta, but in my opinion the one that counts.

computer administration win 10

Solution 4

You could install Netstat or alternatively use the command prompt

netstat -abn

to see the ports in use.

You could also use this method from rackspace to remotely connect to your server.

Share:
82,905
LittleBirdy
Author by

LittleBirdy

Updated on December 23, 2020

Comments

  • LittleBirdy
    LittleBirdy over 3 years

    How can I check whether port 1433 is open for Sql Server or not? I have set in bound and out bound rules, checked in SQL config manager but not sure whether it is working.

  • LittleBirdy
    LittleBirdy almost 8 years
    @Neeraj I got Failed to open loopback connection error
  • LittleBirdy
    LittleBirdy almost 8 years
    @Sprezlaus yes it is simply what i want
  • LittleBirdy
    LittleBirdy almost 8 years
    I am having cmd error for telnet myservername 1433. I can't telnet. why?
  • Dan Guzman
    Dan Guzman almost 8 years
    @LittleBirdy, if you have verified the SQL Server service is running and see the port 1433 listening message in the SQL Server error log, it must be network connectivity. Besides the Windows firewall, there may be another firewall in the way.
  • LittleBirdy
    LittleBirdy almost 8 years
    @Dan Guzman, I can't telnet because i haven't install it. Interesting...what could possibly blocking apart from firewall? Can shed some light on it?
  • Dan Guzman
    Dan Guzman almost 8 years
    @LittleBirdy, perhaps a network trace (both client and server) will provide a clue. If you don't see the packet into the server, it might be a firewall in between. Run TRACEROUTE to see the hops involved and check each.
  • LittleBirdy
    LittleBirdy almost 8 years
    @Dan Guzman Trace completed '1 < 1 ms <1 ms <1 ms Myservername.Domain.com [10.211.55.3]'
  • Dan Guzman
    Dan Guzman almost 8 years
    It doesn't look like there is a firewall in between. Try a network trace.
  • LittleBirdy
    LittleBirdy almost 8 years
    Hi I tried to trace route. It said completed, can you take a look to above image link and help me point if there is unusual thing? Thanks i66.tinypic.com/ih8kr5.jpg
  • Tim_Mac
    Tim_Mac over 2 years
    This configuration was missing for me on a standard install of SQL server 2019, the TCP Port for IPAll was empty. after i set it to 1433 everything worked, thank you!