Manage User Rights and Privileges
To obtain a list of users:
USE mysql; SELECT user FROM user;
CREATE USER ben IDENTIFIED BY 'plaintext';
CREATE USER ben IDENTIFIED BY PASSWORD 'hashed';
RENAME USER ben TO bforta;
DROP USER bforta;
Newly created accounts have no access at all.
SHOW GRANT FOR bforta;
GRANT SELECT ON crashcourse.* TO bforta;
REVOKE SELECT ON crashcourse.* FROM bforta;
When using GRANT and REVOKE, the user account must exist, but the object being referred to need not. This allows administrators to design and implement security before databases and tables are even created. A side effect of this is that if a database or table is removed (with DROP statement) any associated access rights will still exist. And if the database or table is re-created in the future, those rights will apply to them.
GRANT SELECT, INSERT ON crashcourse.* TO bforta;
page_revision: 0, last_edited: 1225615712|%e %b %Y, %H:%M %Z (%O ago)





