Get number of connections being used by a specific user in MySQL

Created at 02-Nov-2023 , By samar

To determine the number of terminals or connections being used by a specific user in MySQL, you can use the following SQL query:

SELECT user, host, count(*) as connections
FROM information_schema.processlist
GROUP BY user, host;

This query retrieves a list of MySQL user accounts, their corresponding hosts, and the count of connections associated with each user and host. The information_schema.processlist table provides information about the currently executing threads and connections in MySQL.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.