Removing User Accounts; Setting Account Resource Limits - Oracle 5.0 Reference Manual

Table of Contents

Advertisement

mysql>
CREATE USER 'myname'@'%.mydomain.com' IDENTIFIED BY 'mypass';
To do the same thing by modifying the grant tables directly, do this:
mysql>
INSERT INTO user (Host,User,Password,...)
->
mysql>
FLUSH PRIVILEGES;

6.3.3. Removing User Accounts

To remove an account, use the
Syntax".
USER

6.3.4. Setting Account Resource Limits

One means of limiting use of MySQL server resources is to set the global
max_user_connections
simultaneous connections that can be made by any given account, but places no limits on what
a client can do once connected. In addition, setting
enable management of individual accounts. Both types of control are of interest to many MySQL
administrators, particularly those working for Internet Service Providers.
In MySQL 5.0, you can limit use of the following server resources for individual accounts:
• The number of queries that an account can issue per hour
• The number of updates that an account can issue per hour
• The number of times an account can connect to the server per hour
• The number of simultaneous connections to the server by an account (available as of MySQL 5.0.3)
Any statement that a client can issue counts against the query limit (unless its results are served from
the query cache). Only statements that modify databases or tables count against the update limit.
An "account" in this context corresponds to a row in the
assessed against the
example, an account
and
User
Host
the
example.com
connections by
the same account.
Before MySQL 5.0.3, an "account" was assessed against the actual host from which a user connects.
This older method accounting may be selected by starting the server with the
[416]
limits
host2.example.com, the server applies the account resource limits separately to each connection.
If
connects again from host1.example.com, the server applies the limits for that connection
usera
together with the existing connection from that host.
To set resource limits for an account, use the
Syntax"). Provide a
limit is zero (no limit). For example, to create a new account that can access the
but only in a limited fashion, issue these statements:
mysql>
CREATE USER 'francis'@'localhost' IDENTIFIED BY 'frank';
mysql>
GRANT ALL ON customer.* TO 'francis'@'localhost'
->
->
->
->

Removing User Accounts

VALUES('%.mydomain.com','myname',PASSWORD('mypass'),...);
DROP USER
[472]
system variable to a nonzero value. This limits the number of
and
User
Host
'usera'@'%.example.com'
values of
and %.example.com, to permit
usera
domain. In this case, the server applies resource limits in this row collectively to all
from any host in the
usera
option. In this case, if
clause that names each resource to be limited. The default value for each
WITH
WITH MAX_QUERIES_PER_HOUR 20
MAX_UPDATES_PER_HOUR 10
MAX_CONNECTIONS_PER_HOUR 5
MAX_USER_CONNECTIONS 2;
statement, which is described in
max_user_connections
mysql.user
values in the
table row that applies to the connection. For
user
corresponds to a row in the
example.com
connects simultaneously from
usera
statement (see
GRANT
600
Section 13.7.1.2,
[472]
table. That is, a connection is
user
to connect from any host in
usera
domain because all such connections use
--old-style-user-
host1.example.com
Section 13.7.1.3,
customer
"DROP
does not
table that has
and
"GRANT
database,

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mysql 5.0

Table of Contents