Account Management Statements
1160
only for those columns for which you have the
INSERT
[577]
privilege. The omitted columns are
set to their implicit default values if strict SQL mode is not enabled. In strict mode, the statement is
rejected if any of the omitted columns have no default value. (Standard SQL requires you to have the
INSERT
[577]
privilege on all columns.)
Section 5.1.7, “Server SQL Modes”
, discusses strict mode.
Section 11.1.7, “Data Type Default Values”
, discusses implicit default values.
13.7.1.4.
RENAME USER
Syntax
RENAME USER
old_user
TO
new_user
[,
old_user
TO
new_user
] ...
The
RENAME USER
statement renames existing MySQL accounts. To use it, you must have the global
CREATE USER
[576]
privilege or the
UPDATE
[578]
privilege for the
mysql
database. An error occurs
if any old account does not exist or any new account exists. Each account name uses the format
described in
Section 6.2.3, “Specifying Account Names”
. For example:
RENAME USER 'jeffrey'@'localhost' TO 'jeff'@'127.0.0.1';
If you specify only the user name part of the account name, a host name part of
'%'
is used.
RENAME USER
causes the privileges held by the old user to be those held by the new user. However,
RENAME USER
does not automatically drop or invalidate databases or objects within them that the old
user created. This includes stored programs or views for which the
DEFINER
attribute names the old
user. Attempts to access such objects may produce an error if they execute in definer security context.
(For information about security context, see
Section 18.5, “Access Control for Stored Programs and
Views”
.)
The privilege changes take effect as indicated in
Section 6.2.6, “When Privilege Changes Take Effect”
.
The
RENAME USER
statement was added in MySQL 5.0.2.
13.7.1.5.
REVOKE
Syntax
REVOKE
priv_type
[(
column_list
)]
[,
priv_type
[(
column_list
)]] ...
ON [
object_type
]
priv_level
FROM
user
[,
user
] ...
REVOKE ALL PRIVILEGES, GRANT OPTION
FROM
user
[,
user
] ...
The
REVOKE
statement enables system administrators to revoke privileges from MySQL accounts.
Each account name uses the format described in
Section 6.2.3, “Specifying Account Names”
. For
example:
REVOKE INSERT ON *.* FROM 'jeffrey'@'localhost';
If you specify only the user name part of the account name, a host name part of
'%'
is used.
For details on the levels at which privileges exist, the permissible
priv_type
and
priv_level
values, and the syntax for specifying users and passwords, see
Section 13.7.1.3, “
GRANT
Syntax”
To use the first
REVOKE
syntax, you must have the
GRANT OPTION
[577]
privilege, and you must have
the privileges that you are revoking.
To revoke all privileges, use the second syntax, which drops all global, database, table, column, and
routine privileges for the named user or users:
REVOKE ALL PRIVILEGES, GRANT OPTION FROM
user
[,
user
] ...
To use this
REVOKE
syntax, you must have the global
CREATE USER
[576]
privilege or the
UPDATE
[578]
privilege for the
mysql
database.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...