mhitza
mhitza

Reputation: 5715

How to find more information about a given MySQL process?

I have a very slow query that is built by the ORM and I'm curios how could I find out the exact query being executed.

I cannot monitor it from the mysql-slow.log because it never finishes the execution (as in I don't have eternity to wait for it, more than an hour in an still waiting).

Also I cannot get the query from the ORM, just after execution. And the only way I think of getting it is from the process list.

show processlist \G

But my problem is that most of the query is trimmed of, even before the from keyword.

This question has been asked before but with no answer https://stackoverflow.com/questions/3741356/find-queries-from-process-id-mysql-5-1-x

Any suggestions?

Upvotes: 1

Views: 1304

Answers (1)

Mchl
Mchl

Reputation: 62349

If your query is formatted in multiple lines, some MySQL clients will only display the first line. To see full output run SHOW FULL PROCESSLIST; query in MySQL console.

Upvotes: 3

Related Questions