I am not really sure why you would need this , but I am just throwing in a possible solution.. First I would say since you need to kill connections on a specific interface (eth0), It would be fair to assume that you have more than one interface, if thats the case and you don't have the "--bind-address" option set in my.cnf, then your mysqld daemon would listen on all the available IP's on all interfaces,

ACK. And that's what I need.

then it is vey difficult to know on what IP did mysql serve a specific connection, unless you would do a netstat, then correspond that IP to the clients IP in "show processlist", etc etc , so pretty cumbersume...

That's what I've done so far ...
I can list and grep all connections on the interface and get the client IP. I can also get the corresponding MySQL Thread-IDs from the mysql-processlist. But I could not find a way to only select connections from a specific Client IP to a specific Server IP, as the Processlist only shows the Client-address.

But unless there is a real need , you can just have the deamon to listen only on one specific IP residing on eth0, like this
--bind-address= xxx.xxx.xx.x ( this IP resides on eth0)

The Server has to listen on all (two) interfaces and clients can connect to both.

If this is feasible in your setup, then killing threads from a specific IP should be easy, if you need to kill threads manually then use a toll like mytop (http://jeremy.zawodny.com/mysql/mytop/ <http://jeremy.zawodny.com/mysql/mytop/>), or if you want it automated then you could easily write a perl script which would parse the output of "show full processlist", get all the connections from a specific client IP, and KILL them ...

Well, that's what I've done ...
But it also kills connections from the client to another interface.

I know this is somewhat special and it would take quite a while to explain why exactly I need this.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to