dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Tip: How to Use the Show ProcessList in MySQL

Learn how to list all of the processes that hold a valid connection to the database.


advertisement

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


This command is similar to that of an operating system command that shows all the processes.

In MySQL, this command, when executed, lists all of the processes that hold a valid connection to the database.

mysql SHOW PROCESSLIST

Typical output is as below

+-------+-----------------+------------------+----------------+---------+-------+-----------------------------+------------------+
| Id    | User            | Host             | db             | Command | Time  | State                       | Info             |
+-------+-----------------+------------------+----------------+---------+-------+-----------------------------+------------------+
|     1 | event_scheduler | localhost        | NULL           | Daemon  | 11991 | Waiting for next activation | NULL             |
|  2141 | dbConn          | MARIADBHOST:50244| platform       | Sleep   |     9 |                             | NULL             |
| 14430 | portal          | MYSQLDB:42526    | management     | Sleep   |    71 |                             | NULL             |
| 14435 | dbUser        | COREEL:37274     | NULL           | Query   |     0 | starting                    | SHOW PROCESSLIST |
+-------+-----------------+------------------+----------------+---------+-------+-----------------------------+------------------+
4 rows in set (0.02 sec)

You can see the the column names are self descriptive and the output is perfect for reporting.

 

Visit the DevX Tip Bank

 





   
Sridhar M S. is a Java developer from Bangalore, India. He holds a master's degree in Computer Science.
Thanks for your registration, follow us on our social networks to keep up-to-date