How to log slow queries in shared hosting MySQL?

Posted by tomaszs on Stack Overflow See other posts from Stack Overflow or by tomaszs
Published on 2010-04-17T17:59:11Z Indexed on 2010/04/17 18:03 UTC
Read the original article Hit count: 302

I have a shared hosting where I have my website and MySQL database. I've installed a open source script for statistics (phpMyVisites) and it started to work very slow lately. It's written using some kind of framework and has many PHP files. I know that to find slow queries I can use slow query log functionality in MySQL. But on this shared hosting I can not use this method because I can not change my.cnf. I don't want to change my statistics script to other and I don't want to mess around with all files of this script to find out where to put diagnostics code to log queries manually. I would like to do it without changes in PHP code.

So my question is:

How to log slow queries in these coditions?:

  • Can't change my.cnf to enable slow query log
  • Can't change statistics script to other
  • Don't know how scrpt is written and where mysql commands are issued
  • Can't ask my provider for slow query log

Is there any method to do this in simple, easy, fast way?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about php