title: Count of all prepared statements (all connections) in mysql
body: <p>My question is similar to <a href="https://stackoverflow.com/questions/12159422/how-to-list-all-prepared-statements-for-all-active-sessions">How to list all prepared statements for all active sessions?</a>, but for MySQL.</p>
  
  <p>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)</p>
  
  <p>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.</p>
  
  <p>I am not fully aware of the prepared statement's lifecycle/possible states, so details in that regard are very welcome.</p>