Note:Cockroach Labs supports the current stable release and two releases prior. Therefore, this version will no longer be supported after the Spring 2019 release.
New in v1.1: The
DROP USER statement removes one or more SQL users.
Tip:You can also use the
cockroach user rmcommand to remove users.
Warning:Removing a user does not remove that user's privileges. Therefore, to prevent a future user with an identical username from inheriting an old user's privileges, it's important to revoke a user's privileges before or after removing the user.
The user must have the
DELETE privilege on the
||The username of the user to remove. To remove multiple users, use a comma-separate list of usernames.
You can use
In this example, we first check a user's privileges. We then revoke the user's privileges before removing the user.
> SHOW GRANTS ON test.customers FOR mroach;
+-----------+--------+------------+ | Table | User | Privileges | +-----------+--------+------------+ | customers | mroach | CREATE | | customers | mroach | INSERT | | customers | mroach | UPDATE | +-----------+--------+------------+ (3 rows)
> REVOKE CREATE,INSERT,UPDATE ON test.customers FROM mroach;
> DROP USER mroach;
- Create Security Certificates
- Other SQL Statements