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.

I just setup a new DB server replacing one that has been live for 5+ years. I normally set the db connections in the host file but now that the new server is up I still see some connections to the old server how can I track down where those connections are coming from?

share|improve this question

2 Answers 2

If you log into the old MySQL server and run the following:

mysql> show processlist;

You should see a list of all active connections, with the source host in the 3rd column. It should be of the form:

serverhost:12345

Where serverhost is the hostname you're looking for and 12345 is the source port. If you want to track down the process that's connecting to MySQL, on serverhost run the following:

serverhost# lsof -i :12345

You should get something like this:

COMMAND   PID USER   FD   TYPE     DEVICE SIZE NODE NAME
program 5954 root   27u  IPv4 -780315302       TCP serverhost:12345->mysqlserver:mysql (ESTABLISHED)

So in this example, command program at PID 5954 is the offender.

Hope this helps.

share|improve this answer

You can view same informations explained by vmfarms also using Mysql Administrator (old gui) or Mysql WorkBench, into the section "Server Connections", after you login into the server as root.

share|improve this answer

Your Answer

 
discard

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