Is there a way in MySQL 5 to show only the current user's processes(queries)?
The user has the PROCESS
privilege, therefore SHOW PROCESSLIST
displays running processes of all users. According to the documentation, SHOW PROCESSLIST
does not allow any kind of WHERE
syntax, nor did I manage to make it into a subquery.
Of course, I could simply send the query, e.g. in a PHP script, and go through the results in a loop, discarding everything that's not mine, but it seems rather inefficient. Changing the user privileges is not feasible.
Are there any other ways? Thanks in advance.
If you use MySQL 5.1.7 or newer, you can use the PROCESSLIST table in the INFORMATION_SCHEMA. So you can query it with ordinary SELECT
queries and apply filtering conditions in a WHERE
clause.
This feature is not implemented in MySQL 5.0 and prior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With