Skip to content

Instantly share code, notes, and snippets.

@craigvantonder
Created November 30, 2024 22:04
Show Gist options
  • Save craigvantonder/64d3bf4f639714e23c93e898ea581ba3 to your computer and use it in GitHub Desktop.
Save craigvantonder/64d3bf4f639714e23c93e898ea581ba3 to your computer and use it in GitHub Desktop.
Show active connections along with their ciphers in MySQL.

Sometimes it can be useful to know which ciphers certain connections are utilising, this will how you the active connections along with their ciphers if applicable.

Reference: https://security.stackexchange.com/a/260139/40579

SELECT t.THREAD_ID,
       t.PROCESSLIST_USER,
       t.PROCESSLIST_HOST,
       t.CONNECTION_TYPE,
       sbt.VARIABLE_VALUE AS cipher
FROM performance_schema.threads t
LEFT JOIN performance_schema.status_by_thread sbt
ON (t.THREAD_ID = sbt.THREAD_ID AND sbt.VARIABLE_NAME = 'Ssl_cipher')
WHERE t.PROCESSLIST_USER IS NOT NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment