DBA Hub

📋Steps in this guide1/1

Find current sessions in MySQL

Show all processes in mysql cluster.

mysql configurationintermediate
by MYSQL
13 views
1

Find current sessions in MySQL

Show all processes in mysql cluster. Show processes for a specific user: Show processes for a particular database:

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
mysql>
show processlist;
+----+-----------------+-----------+------+---------+-------+------------------------+------------------+
| Id | User            | Host       | db  | Command | Time  | State                  | Info |
+----+-----------------+-----------+------+---------+-------+------------------------+------------------+
| 5  | event_scheduler | localhost | NULL | Daemon | 34888 | Waiting on empty queue | NULL |
| 23 | root            | localhost | test | Sleep. | 36    | | NULL                 |
| 24 | root.           | localhost | NULL | Query  | 0      | init                   | show processlist |
+----+-----------------+-----------+------+---------+-------+------------------------+------------------+
3 rows in set (0.00 sec)
mysql>
select * from information_schema.processlist where user='root'\G
mysql>
select * from information_schema.processlist where DB='test';
+----+------+-----------+------+---------+------+-------+------+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+----+------+-----------+------+---------+------+-------+------+
| 23 | root | localhost | test | Sleep | 70 | | NULL |
+----+------+-----------+------+---------+------+-------+------+
1 row in set (0.00 sec)

Comments (0)

Please to add comments

No comments yet. Be the first to comment!