Skip to content

Instantly share code, notes, and snippets.

@tkhk
Last active May 31, 2017 04:10
Show Gist options
  • Save tkhk/ae3590e9a976eed11c226405892599b7 to your computer and use it in GitHub Desktop.
Save tkhk/ae3590e9a976eed11c226405892599b7 to your computer and use it in GitHub Desktop.
the number of connections to MySQL (group by HOST)
SELECT COUNT(*), SUBSTRING(HOST, 1, POSITION(':' in HOST)-1) AS ip FROM INFORMATION_SCHEMA.PROCESSLIST GROUP BY ip;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment