User & Role
This page provides a comprehensive overview of user and role operations in Databend, organized by functionality for easy reference.
User Management
Command | Description |
---|---|
CREATE USER | Creates a new user account |
ALTER USER | Modifies an existing user account |
DROP USER | Removes a user account |
DESC USER | Shows detailed information about a user |
SHOW USERS | Lists all users in the system |
Role Management
Command | Description |
---|---|
CREATE ROLE | Creates a new role |
DROP ROLE | Removes a role |
SET ROLE | Sets the current active role for the session |
SET SECONDARY ROLES | Sets secondary roles for the session |
SHOW ROLES | Lists all roles in the system |
Privilege Management
Command | Description |
---|---|
GRANT | Assigns privileges to users or roles |
REVOKE | Removes privileges from users or roles |
SHOW GRANTS | Shows privileges granted to users or roles |
备注
Proper user and role management is essential for database security. Always follow the principle of least privilege when granting permissions.