Show running processes in MySQL

We can get the current running processes in MySQL using ‘show processlist’. This will give us the username, connected database, CPU, query running by user.

show processlist;

mysql> show processlist; +----+---------+-----------+---------+---------+------+----------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+---------+-----------+---------+---------+------+----------+------------------+ | 26 | root | localhost | sakila | Query | 0 | starting | show processlist | | 29 | mgeorge | localhost | company | Sleep | 2 | | NULL | +----+---------+-----------+---------+---------+------+----------+------------------+ 2 rows in set (0.00 sec)

To get readable format use \G delimiter after show processlist as shown below.

show processlist\G;

mysql> show processlist\G; *************************** 1. row *************************** Id: 26 User: root Host: localhost db: sakila Command: Query Time: 0 State: starting Info: show processlist *************************** 2. row *************************** Id: 29 User: mgeorge Host: localhost db: company Command: Sleep Time: 13 State: Info: NULL 2 rows in set (0.00 sec)

Related Posts

CheapSexCams
Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by k2schools
%d bloggers like this: