Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

4 Answers

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

share|improve this answer
    
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
add comment

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

share|improve this answer
    
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
add comment

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.

share|improve this answer
    
Yeah, normally it's MySQL that uses 3306 by default. –  db2 Mar 30 '11 at 12:20
add comment

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.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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