Port Problem

Edward Glowacki glowack2@msu.edu
Thu, 6 Jul 2000 12:41:22 -0400 (EDT)


On Thu, 6 Jul 2000, Michael Malinak wrote:
> Ok so MySQL crashed on my server and now when I try to start it again it
> says the port is in use.  Is there any way of clearing the port?  I know
> rebooting would work, but who want's to trash a 52 day uptime.

Make sure the MySQL process is really dead, sometimes processes crash but
still hang around (either zombied or apparently running normally even
though they should have exited).  You can double check to see if the port
is being used by running "netstat -Aan" (that's the FreeBSD command, don't
have my linux box at home running right now[1] so check the man page of
netstat for the correct options, you want the one that shows which sockets
are assigned to which ports), then "fstat |grep
whatever-your-socket-identifier-is" should tell you what program is using
it.  Here's a sample:

> netstat -Aan
Socket   Proto Recv-Q Send-Q Local Address         Foreign Address (state)
c9287de0 tcp        0      0 *.5432                *.*             LISTEN

> fstat | grep c9287de0
pgsql    postgres     245    3* internet stream tcp c9287de0

>ps ax | grep postgres
  245  ??  IWs    0:00.00 (postgres)

And the footnotes, pfaffben style! ;)
[1] It's in Windoze because I'm addicted to Diablo II ;)

-- 
Edward Glowacki			glowack2@msu.edu
Network Services		
Michigan State University