I want to know is there anyway to get CPU usage per user in MySQL? for example I have 3 different users 'user1', 'user2' and 'user3'. I want to get the average/real time memory usage and CPU usage of these users.I googled a lot but I did not find any suitable tool. Maybe I can get these data from MySQL queries, but I don't know where are they stored.
Why do you want it? If it is to see who is using the CPU more, then use the slowlog and some digest such as pt-query-digest.
In a well-tuned production system the CPU is not heavily used. So it should not matter who is using the CPU.