On a server running Windows Server 2003 I killed the TS-service (specifically the svchost.exe which belongs to terminal services).

The service is not running anymore but the server is still listening on port 3306 (as is seen by running netstat -a).

How can I force this port closed?


This rule has enough information to make a port rule on the WS2K8 system. Within netsh, this rule would be entered as:

netsh advfirewall firewall add rule name="3306" protocol=TCP dir=in localport=3306 action=block

  • Thank you. I just want to close it one time so that I can start the TS-Service. Your solution seems to block it forever.
    – Ueli
    Dec 3 '10 at 8:40

You could use Nisoft's CurrPorts for monitoring and closing TCP connections on Windows machines.

  • Sounds good, but TS isn't restartable in 2003. Wonder why killing the service was necessary... (wonder what the real-real problem is)
    – TristanK
    Mar 30 '11 at 11:19

Hmmm. Port 3306... for TS. I'm assuming you're referring to Terminal Services? So you must have changed the RDP port then right, because Terminal Services normally runs on port 3389? Try running netstat -a -b -o to see the executable and PID responsible for each connection to verify that it's TS that has port 3306 open.

  • Yeah, normally it's MySQL that uses 3306 by default.
    – db2
    Mar 30 '11 at 12:20

We had the same problem and used Process Explorer from Microsoft Sysinternals to look up the process id (PID) that no longer existed.

It turns out that the process was referenced by several DrWatson processes. Killing those processes released the port. (DrWatson is used to send memory dumps to Microsoft and this was taking several hours because the process that crashed held several tens of GBs of memory at the time.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.