There are several ways to suggest.
SELECT * FROM information_schema.PROCESSLIST WHERE USER="someuser"; Now you decide what you use. Write cronjob (linux) to save it to a file or write a MySQL event to inject it into the mysql table.- Use a common query log and use tools like linux awk, sed, grep, etc. to parse the log file to get the desired result.
But if you don't know how to write the linux command line, you can use mk-query-digest or even set up custom monitoring tools like nagios , cacti , etc. But I personally prefer MONyog , it works great for both point 1 and 2, and best of all has a graphical interface.

Rituparna kashyap
source share