How can I get the rows from SHOW PROCESSLIST using MySQL Connector for .NET or Dapper?

c# dapper mysql mysql-connector

Question

I need to parse the running queries on my MySQL server. What is the easiest way to retrieve the result of SHOW PROCESSLIST from within MySQL Connector for .NET, or using Dapper?

Maybe something like (with Dapper):

var rows = connection.Query("SHOW PROCESSLIST");

Accepted Answer

The results of most MySQL meta-commands are represented in the INFORMATION_SCHEMA pseudo-database:

SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why