Oracle 5.0 Reference Manual page 621

Table of Contents

Advertisement

The limit types need not all be named in the
in any order. The value for each per-hour limit should be an integer representing a count
per hour. For MAX_USER_CONNECTIONS, the limit is an integer representing the maximum
number of simultaneous connections by the account. If this limit is set to zero, the global
max_user_connections
connections. If
max_user_connections
To modify existing limits for an account, use a
The following statement changes the query limit for
mysql>
GRANT USAGE ON *.* TO 'francis'@'localhost'
->
WITH MAX_QUERIES_PER_HOUR 100;
The statement modifies only the limit value specified and leaves the account otherwise unchanged.
To remove a limit, set its value to zero. For example, to remove the limit on how many times per hour
can connect, use this statement:
francis
mysql>
GRANT USAGE ON *.* TO 'francis'@'localhost'
->
WITH MAX_CONNECTIONS_PER_HOUR 0;
As mentioned previously, the simultaneous-connection limit for an account is determined from the
MAX_USER_CONNECTIONS
that the global
max_user_connections
specified with GRANT:
GRANT ... TO 'user1'@'localhost' WITH MAX_USER_CONNECTIONS 0;
GRANT ... TO 'user2'@'localhost' WITH MAX_USER_CONNECTIONS 5;
GRANT ... TO 'user3'@'localhost' WITH MAX_USER_CONNECTIONS 20;
has a connection limit of 10 (the global
user1
has a zero
MAX_USER_CONNECTIONS
respectively, because they have nonzero
The server stores resource limits for an account in the
The max_questions, max_updates, and
the
max_user_connections
"Privilege System Grant
upgraded; see
Section 4.4.9,
Resource-use counting takes place when any account has a nonzero limit placed on its use of any of
the resources.
As the server runs, it counts the number of times each account uses resources. If an account reaches
its limit on number of connections within the last hour, further connections for the account are rejected
until that hour is up. Similarly, if the account reaches its limit on the number of queries or updates,
further queries or updates are rejected until the hour is up. In all such cases, an appropriate error
message is issued.
Resource counting is done per account, not per client. For example, if your account has a query limit of
50, you cannot increase your limit to 100 by making two simultaneous client connections to the server.
Queries issued on both connections are counted together.
The current per-hour resource-use counts can be reset globally for all accounts, or individually for a
given account:
• To reset the current counts to zero for all accounts, issue a
The counts also can be reset by reloading the grant tables (for example, with a
statement or a
mysqladmin reload
• The counts for an individual account can be set to zero by re-granting it any of its limits. To do this,
use
as described earlier and specify a limit value equal to the value that the account
GRANT USAGE
currently has.
Setting Account Resource Limits
WITH
[472]
system variable value determines the number of simultaneous
[472]
GRANT USAGE
limit and the
max_user_connections
[472]
max_user_connections
limit).
user2
MAX_USER_CONNECTIONS
max_connections
column stores the
Tables".) If your
table does not have these columns, it must be
user
"mysql_upgrade
command).
601
clause, but those named can be present
is also zero, there is no limit for the account.
statement at the global level
to 100:
francis
[472]
value is 10 and three accounts have resource limits
and
have connection limits of 5 and 20,
user3
limits.
table row corresponding to the account.
user
columns store the per-hour limits, and
MAX_USER_CONNECTIONS
— Check Tables for MySQL
FLUSH USER_RESOURCES
(ON
*.*).
system variable. Suppose
[472]
value) because it
limit. (See
Section 6.2.2,
Upgrade".
statement.
FLUSH PRIVILEGES

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents