RENAME USERold_user
TOnew_user
[,old_user
TOnew_user
] ...
The RENAME USER
statement renames
existing MySQL accounts. To use it, you must have the global
CREATE USER
privilege or the
UPDATE
privilege for the
mysql
database. An error occurs if any old
account does not exist or any new account exists. Each account
is named using the same format as for the
GRANT
statement; for example,
'jeffrey'@'localhost'
. If you specify only
the user name part of the account name, a host name part of
'%'
is used. For additional information about
specifying account names, see Section 12.4.1.3, “GRANT
Syntax”.
RENAME USER
does not
automatically migrate any database objects that the user
created, nor does it migrate any privileges that the user had
prior to the renaming. This applies to tables, views, stored
routines, triggers, and events.
User Comments
Add your own comment.