If you have lots of sleeping processes the chances are you have a poorly written app that is not closing its database connections. Those sleeping processes are just connections waiting for another command from the application or whatever else initiated them.
The sleeping processes will not show up in the slow query log because they are not slow queries and you cannot see the sql they are running because they aren't running any. If you need to prevent these building up (and you do because they will eat away at system resources) you can add a wait_timeout option to your my.cnf / my.ini file but the best way to control these is ensure your app closes its connections when it is finished with them and do not use persistent connections unless absolutely necessary Regards John -------------------------------- John Daisley SQL Server 2005/2008 Database Administrator Certified MySQL 5 Database Administrator Certified MySQL 5 Developer Cognos BI Developer Telephone: +44 (0)7918 621621 Email: john.dais...@butterflysystems.co.uk --------------------------------- On 12 July 2010 16:39, Machiel Richards <machi...@rdc.co.za> wrote: > Hi All > > > > I am trying to find out how to see the exact query being > run. > > > > When running show processlit, I get a lot of processes that > have been running for a VERY long time. > > > > I a trying to find out exactly what query it is that is > being run , any ideas? > > > > I tried the slow query log but it is not showing up in > there. > > > > All the queries are showing “sleep” > > > > Not sure if this means anything.... > > > > Machiel Richards > > MySQL DBA > > Relational Database Consulting > > > > [image: RDC_Logo] > > > -- John Daisley Certified MySQL 5 Database Administrator Certified MySQL 5 Developer Cognos BI Developer Telephone: +44 (0)7918 621621 Email: john.dais...@butterflysystems.co.uk