Marty Wallace
Marty Wallace

Reputation: 35734

Profiling mysql in realtime - find long running queries

From the command line (linux) how can i zero in on long running mysql queries?

For exammple, I can use "top" on a linux box and see that mysqld is hogging lots of memory. Are there any mysql command line commands i can use to go into further details and narrow down the culprit queries?

Upvotes: 1

Views: 3108

Answers (1)

Erik Ekman
Erik Ekman

Reputation: 2066

mytop shows the currently running queries. You can also tell mysql to create a slowlog, a log of all queries taking more than a certain time to complete.

Upvotes: 1

Related Questions