Does MySQL log successful or attempted queries?
- by Nathan Long
I'm trying to track down a hit-or-miss bug in a web application. Sometimes a request completes just fine; sometimes it hangs and never finishes.
I see that Apache now has several requests listed on the server-status page as "sending reply," and that doesn't change. I'm testing on localhost, so there shouldn't ever be more than one.
Out of curiosity, I set MySQL to log all queries and I'm tail -fing the log file.
When things go OK, I see a pattern like this:
20 Connect root@localhost on dbname
20 Query (some query #1)
20 Query (some query #2)
(etc)
20 Quit
21 Connect (etc)
When it hangs, I see a pattern like this:
22 Connect root@localhost on dbname
22 Query (some query #1)
//nothing happens, so I try the post again
23 Connect root@localhost on dbname
23 Query (some query #1)
//nothing happens; try again
24 Connect (etc)
Here's my question: is MySQL logging attempted queries, or successful queries? In other words, if the last line I see is query #1, does that imply that query #1 or query #2 is hanging?
My guess is that the one I don't see is the problem, because the last one I see looks fine, but maybe the one I don't see is too screwed-up for MySQL to process. Thoughts?