Jump to content


Help: How to find MySQL query log?

  • Please log in to reply
2 replies to this topic

#1 Ozz

  • Members
  • Pip
  • Newbie
  • 4 posts

Posted 07 December 2005 - 02:16 PM

I have huge load on my site because of mysql database queries.
I did necessary indexes and make some optimisations on data values. Now I'm tryin "EXPLAIN SELECT" query to find slow queries.
But if I get a query log with query times that will be a shortcut to find the problem.
Has mysql got a query log and where can I find it?
Do you recommend a tool or script to log mysql queries?
If I can see on the server that would be so helpful. But I can try on my windows localhost too.
[a href="http://www.limk.com/english/" target="_blank"]Limk.com[/a]

#2 Arenium

  • Staff Alumni
  • Advanced Member
  • 111 posts
  • LocationMassachusetts

Posted 11 December 2005 - 03:10 AM

:) Apparently you're not the first person to have this dilemma: [a href=\"http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html\" target=\"_blank\"]See here[/a].

#3 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 24 December 2005 - 02:47 AM

You can definitely turn on general query logging; however, I recommend using the [a href=\"http://dev.mysql.com/doc/refman/4.1/en/slow-query-log.html\" target=\"_blank\"]slow query log[/a] instead -- it narrows down the log quite a bit, and makes it much easier to find the offending queries.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users