显示Processlist从另一个表中获取信息。 以下是如何提取数据并查看包含整个查询的“INFO”列:
select * from INFORMATION_SCHEMA.PROCESSLIST where db = 'somedb';
您可以根据您的要求添加任何条件或忽略。
查询的输出结果如下:
+-------+------+-----------------+--------+---------+------+-----------+----------------------------------------------------------+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+-------+------+-----------------+--------+---------+------+-----------+----------------------------------------------------------+
| 5 | ssss | localhost:41060 | somedb | Sleep | 3 | | NULL |
| 58169 | root | localhost | somedb | Query | 0 | executing | select * from sometable where tblColumnName = 'someName' |