zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

MySQL: Show processlist every second

November 28, 2010 by Igor Drobot 6 Comments

MySQL-Logo

1
mysqladmin -u root -p -i 1 processlist

mysqladmin -u root -p -i 1 processlist

-u username
-p you will be promted for a password
-i 1 interval one second

Output will see like this one:

1
2
3
4
5
6
7
8
9
+--------+------+-------------------+-----+---------+------+-------+------------------+
| Id     | User | Host              | db  | Command | Time | State | Info             |
+--------+------+-------------------+-----+---------+------+-------+------------------+
| 424111 | db4  | 192.168.2.1:58431 | db4 | Sleep   | 15   |       |                  |
| 424195 | db4  | 192.168.2.1:50531 | db4 | Sleep   | 1    |       |                  |
| 424483 | db3  | 192.168.2.1:41503 | db3 | Sleep   | 464  |       |                  |
| 424490 | db3  | 192.168.2.1:41513 | db3 | Sleep   | 443  |       |                  |
| 424551 | root | localhost         |     | Query   | 0    |       | show processlist |
+--------+------+-------------------+-----+---------+------+-------+------------------+

+--------+------+-------------------+-----+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +--------+------+-------------------+-----+---------+------+-------+------------------+ | 424111 | db4 | 192.168.2.1:58431 | db4 | Sleep | 15 | | | | 424195 | db4 | 192.168.2.1:50531 | db4 | Sleep | 1 | | | | 424483 | db3 | 192.168.2.1:41503 | db3 | Sleep | 464 | | | | 424490 | db3 | 192.168.2.1:41513 | db3 | Sleep | 443 | | | | 424551 | root | localhost | | Query | 0 | | show processlist | +--------+------+-------------------+-----+---------+------+-------+------------------+

Filed Under: MySQL Tagged With: Database, MySQL, Process List

Categories

Archives

Tags

apache2 Apple arduino ARM Automation backup bash Cisco Cluster Corosync Database Debian Debian squeeze DIY DNS Fedora FTP Fun Icinga Ipv6 KVM Linux LVM MAC OS X Monitoring MySQL Nagios Nginx openSUSE OpenVPN PHP Proxy Python python3 qemu RAID rsync Samba security ssh Ubuntu virtualization Windows Windows 7 Wordpress

Comments

  1. Saran says

    August 7, 2023 at 18:39

    How to print the Entire Query

  2. Ahmed says

    December 21, 2021 at 16:35

    Thanks!

  3. Guest says

    October 26, 2018 at 10:30

    thank you

  4. jay says

    February 16, 2018 at 10:59

    Thanks , It works perfectly .

  5. Danny Feliz says

    April 8, 2016 at 18:11

    You don’t know how much a I’ve been needing this, for real, thank you man :D

  6. Jeremy Glover says

    February 20, 2016 at 16:40

    This worked out perfectly for me. Thanks for the tip! It made monitoring the queries on MySQL much easier and faster.

Leave a Reply

Your email address will not be published. Required fields are marked *

Yeaaah Cookie! We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok