HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Viewing MySQL Account Resource Limits

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
viewingresourceaccountlimitsmysql

Problem

Is there any way of viewing an account's remaining resources that are allocated to it? I setup an account that's allowed 7200 queries an hour. At any point, could I then run a query to find out how many remaining queries it's allowed?

MySQL must be storing this information somewhere as FLUSH USER_RESOURCES; will reset the counters however, I tried a few variants such as SHOW USER_RESOURCES and they don't seem to display anything. I've also hunted around information_schema and mysql tables.

Is it just not possible to retrieve that information?

Solution

User resources are store in "mysql.user" table :

SELECT max_questions, 
       max_updates, 
       max_connections 
FROM   mysql.user 
WHERE  user = 'myuser'
AND    host = '%';


Max.

Code Snippets

SELECT max_questions, 
       max_updates, 
       max_connections 
FROM   mysql.user 
WHERE  user = 'myuser'
AND    host = '%';

Context

StackExchange Database Administrators Q#31190, answer score: 3

Revisions (0)

No revisions yet.