In MySQL, we can use the sys.ps_is_account_enabled()
function to check whether Performance Schema instrumentation for a given account is enabled.
The function returns YES
or NO
, depending on whether or not the instrumentation for the given account is enabled.
Syntax
The syntax goes like this:
sys.ps_is_account_enabled(host,user)
Example
Here’s an example to demonstrate:
SELECT sys.ps_is_account_enabled('localhost', 'barney');
Result:
YES
In this case, Performance Schema instrumentation is enabled for the user barney
on localhost
.