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


Tip of the Day
Language: SQL
Expertise: Intermediate
May 16, 2019

WEBINAR:

On-Demand

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


How to Use the Show ProcessList in MySQL

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.

M S Sridhar
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Thanks for your registration, follow us on our social networks to keep up-to-date