Purpose
You can use this statement to drop a role.
Limitations and considerations
- When you drop a role, it will be revoked from all users and roles to which this role is granted, and be dropped from the database.
- Roles defined in the system variable
mandatory_rolescannot be dropped. - When you use this statement to drop multiple roles, if one of the roles fails to be dropped, the entire drop operation will be rolled back and none of the roles will be dropped.
Required privileges
You must have the CREATE USER privilege. For more information about privileges in OceanBase Database, see Privilege types in MySQL mode.
Syntax
DROP ROLE role_name [, role_name ...];
Parameters
| Parameter | Description |
|---|---|
| role_name | The name of the role to be dropped. Separate multiple roles with commas (,). |
Examples
Drop the role role001.
DROP ROLE role001;