Oracle 5.0 Reference Manual page 1170

Table of Contents

Advertisement

• To assign a password, use
CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass';
• To avoid specifying the plaintext password if you know its hash value (the value that
PASSWORD()
PASSWORD:
CREATE USER 'jeffrey'@'localhost'
IDENTIFIED BY PASSWORD '*90E462C37378CED12064BB3388827D2BA3A9B689';
For additional information about setting passwords, see
The
CREATE USER
13.7.1.2.
DROP USER
DROP USER
user
The
DROP USER
global
CREATE USER
account name uses the format described in
DROP USER 'jeffrey'@'localhost';
If you specify only the user name part of the account name, a host name part of
DROP USER
5.0.2, it was modified to remove account privileges as well. This means that the procedure for removing
an account depends on your version of MySQL.
As of MySQL 5.0.2, you can remove an account and its privileges as follows:
DROP USER user;
The statement removes privilege rows for the account from all grant tables.
Before MySQL 5.0.2,
accounts that have no privileges. To remove a MySQL account completely (including all of its
privileges), you should use the following procedure, performing these steps in the order shown:
1. Use
SHOW GRANTS
GRANTS
2. Use
REVOKE
account from all the grant tables except the
the
user
Account Management Statements
IDENTIFIED BY
[956]
would return for the password), specify the hash value preceded by the keyword
Important
may be recorded in server logs or in a history file such as
CREATE USER
~/.mysql_history, which means that cleartext passwords may be read by
anyone having read access to that information. See
Passwords
Secure".
Important
Some releases of MySQL introduce changes to the structure of the grant tables
to add new privileges or features. Whenever you update to a new version of
MySQL, you should update your grant tables to make sure that they have the
current structure so that you can take advantage of any new capabilities. See
Section 4.4.9,
"mysql_upgrade
statement was added in MySQL 5.0.2.
Syntax
[, user] ...
statement removes one or more MySQL accounts. To use it, you must have the
[576]
privilege or the
as present in MySQL 5.0.0 removes only accounts that have no privileges. In MySQL
serves only to remove account rows from the
DROP USER
to determine what privileges the account has. See
Syntax".
to revoke the privileges displayed by
table. See
Section 13.7.1.3,
with the literal plaintext password value:
Section 6.3.5, "Assigning Account
— Check Tables for MySQL
[577]
privilege for the
DELETE
Section 6.2.3, "Specifying Account
GRANTS. This removes rows for the
SHOW
table, and revokes any global privileges listed in
user
"GRANT
Syntax".
1150
Passwords".
Section 6.1.2, "Keeping
Upgrade".
database. Each
mysql
Names". For example:
is used.
'%'
table for
user
Section 13.7.5.17,
"SHOW

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents