Drop a role

2024-06-28 05:30:31  Updated

This topic describes how to drop a role that you no longer need by using the DROP ROLE statement.

Prerequisites

You have the CREATE USER privilege. For more information about how to view your privileges, see View user privileges. If you do not have the required privilege, contact the administrator to obtain the privilege. For more information about how to grant privileges to a user, see Grant direct privileges.

Notice

When you drop a role, the system automatically revokes the role from all users and roles that are granted the role and deletes it from the database.

Examples

  • Drop the role named role1.

    obclient [oceanbase]> DROP ROLE role1;
    
  • Drop the role1 and role2 roles.

    obclient [oceanbase]> DROP ROLE role1,role2;
    

References

For more information about the DROP ROLE statement, see DROP ROLE.

Contact Us