Count the number of queries to a MySQL server

echo "SHOW PROCESSLIST\G" | mysql -u root -p | grep "Info:" | awk -F":" '{count[$NF]++}END{for(i in count){printf("%d: %s\n", count[i], i)}}' | sort -n

6
By: bpfx
2009-02-05 14:24:20

1 Alternatives + Submit Alt

What Others Think

Many ways to skin a cat, but i think this is better: http://www.commandlinefu.com/commands/view/10407/monitor-mysql-threads-per-user
anarcat · 502 weeks and 2 days ago
I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. N95 Face Mask
KayGasaway · 17 weeks and 6 days ago
I really impressed after read this because of some quality work and informative thoughts . I just wanna say thanks for the writer and wish you all the best for coming!. buy delta 8
KayGasaway · 15 weeks and 1 day ago
Find the right Luxury hotel for your honeymoon Rawnaq Tourism recommends the Best Maldives Hotels ?depending on your individual needs
KayGasaway · 13 weeks and 5 days ago
Water and Waste Plumbing are your Local Plumber Darwin. We are certified plumbers and proudly offer an array of plumbing services at affordable prices. stormwater pit installation
KayGasaway · 12 weeks and 4 days ago
Winner of Best of Yolo County 2020 and Best of Weedmaps Kind Farma is Davis Californias Premier medical and recreational Cannabis dispensary. http://www.kindfarma.com">kind dispensary
KayGasaway · 12 weeks and 4 days ago
Enamel Badges provides a massive range of custom enamel badges in the UK. we offer soft and hard enamel badges, die struck badges, and printed badges. enamel badges
KayGasaway · 11 weeks ago
Beckside Machinery offering Compact Tractor Power Harrows, View our Power Harrows Beckside Machinery, the UK s premier compact tractor attchment company, Please visit our website for more informations, Thank You. http://www.technology.bookmarking.site/News/power-harrow/">power harrow
ayesha · 8 weeks and 1 day ago
Shop Black Obsidian Healing Crystal Bracelet |black obsidian bracelet ?is 8mm Natural Handmade Beaded Stretchy-Cord Stone For Reiki, Meditation & Chakra Energy - Soul Charms
KayGasaway · 5 weeks and 3 days ago
Many homework on the continual hunt along with offstage on the road to winning. Definitely not attached, simple to-fall as a result of wayside; And not investigation, afterward into a path travel toward the black. spyphone
jackson2321 · 4 weeks ago
Are you intrested in studying in Canada or looking for Canada visa, Dreamland Immigration is skilled professional ICCRC certified Canadian immigration consultants with years of experience and numerous successful immigration cases, Our goal is getting our clients to Canada in the shortest time with lowest cost possible through a variety of avenues. We have made it our primary goal to assist our clients in persuading the authorities to grant them a visa.
KayGasaway · 3 weeks and 6 days ago
Howley Carpet Providing upholstery cleaner cork ?with professional and reliable Prices cleaning services to domestic and commercial customers in Fermoy, Co Cork, Please visit our site for more details, Thank You.
KayGasaway · 3 weeks and 5 days ago
If You are looking for luxurious quality scented candles in singapore, Visit these following anchors: candle singapore or scented candles singapore &Save 15% off your first order by signing up for our occasional emails. Let us know your birth date to get a $10 birthday voucher!
KayGasaway · 3 weeks and 2 days ago
Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work! Visit Website
KayGasaway · 6 days ago
A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. Read More Here
KayGasaway · 6 days ago
Soulage les douleurs cervicales rapidement et efficacement. Détente et relaxation assurées. La traction cervicale à la maison, à essayer ! Livraison offerte hamac de cou
KayGasaway · 6 days ago
Professional grade light therapy skin rejuvenation led face mask, As Mirage LED photorejuvenation face mask ?comprising an industry leading 204 individual units of the most powerful Light Emitting Diodes LEDs ever manufactured for an at home portable LED face mask ? Guaranteed reduction in wrinkles fine line
KayGasaway · 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: