4

I have trouble finding the port for a running SQL Server (SQLEXPRESS):

The command tasklist in CMD shows PID = 3376 for sqlservr.exe.

It's the same PID as in the Properties of this SQL Server (looked up under SQL Server Configuration Manager (Local) / SQL Server Services / SQL Server (SQLEXPRESS)). The property State is Running for this SQL Server.

However, the command netstat -ano in CMD does not show any port for this PID.

I assumed that there would be an automatic allocation of this service (this PID) to a port. Is my assumption wrong? If yes, how can I assign a specific service to a port?

Does the service have to be in the list of SQL Server Network Configuration as shown here? If yes, how to transfer the running SQL Server to this list?

7
  • Have you enabled TCP/IP in the SQL Server Configuration Manager? I'm reading that it is disabled by default. In the TCP/IP Properties, there should be two fields for Port and Dynamic Ports.
    – root
    Commented Apr 4, 2018 at 13:55
  • I googled for sql server port, and google returned that it uses port 1433. I then did netstat -aon | grep "1433" and it listed it, and I checked the PID and it's sqlservr.exe. i'm running smss(sql studio), which uses sql server 2014. Do you see anything on that port?
    – barlop
    Commented Apr 4, 2018 at 14:16
  • @root: I have not found the option to enable TCP/IP for my SQL Server which is currently listed in SQL Server Services. This post demonstrates this process for SQL Servers listed in SQL Server Network Configuration only.
    – stonebe
    Commented Apr 4, 2018 at 14:26
  • @barlop: No, I unfortunately can't see anything with netstat -aon or netstat -aon | findstr 1433 which has to do with 1433.
    – stonebe
    Commented Apr 4, 2018 at 14:29
  • can you try to create a database? do you get any errors if you try to reinstall it? / did you get any errors when you tried to install it? You could try installing SMSS it has an SQL Server docs.microsoft.com/en-us/sql/ssms/…
    – barlop
    Commented Apr 4, 2018 at 14:41

1 Answer 1

1

Since you know the PID of the process running you could use the below netstat command piped over to the findstr command followed by the PID number to display applicable detail including the port number that that process is listening.

  • netstat -ano | findstr "<PID>"

To resolve this issue it should be as simple as adjusting the SQL Server Network Configuration accordingly or opening up the necessary ports, programs, etc. with the Windows Firewall rules.


Further Resources

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .