mysql: Is there any way to close mysql connections which are in sleep mode for more than 10 minutes
===

Recently I observed on one of the production server, many connections are in sleep mode for more than 3 hours or so. I would like to whether we have a way in mysql which if we set, will automatically close these long sleeping connections.

I have given a read like running "flush tables" manually will do this but I want it to happen automatically by mysql. is there solution as such

If i make a script which will connect to mysql and run "flush tables" periodically, does it become a problem in any way...

Thanks in advance...