8

My question is similar to How to list all prepared statements for all active sessions?, but for MySQL.

I have a program (prosody XMPP server) that seems to be leaking prepared statements. To diagnose the problem, I want a list of all "open" prepared statements. (even prepared statements by 'dead' connections, if such exist)

The statements in question are, as far as I can tell, all created by the MySQL user 'prosody', so I'd like to list all statements created by this user. However, it'd be also nice to have a list of all statements for all users.

I am not fully aware of the prepared statement's lifecycle/possible states, so details in that regard are very welcome.

1 Answer 1

14

It turned out to be very simple:

SHOW GLOBAL STATUS LIKE '%prepared_stmt_count%';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.