Help Center/
CloudTable Service/
User Guide/
ClickHouse User Guide/
ClickHouse Cluster Management/
ClickHouse Role Management/
Using Role Management Commands
Updated on 2024-12-24 GMT+08:00
Using Role Management Commands
This section describes how to use basic syntax and SQL statements to manage roles.
- Creating a role ( role_name indicates the name of the role to be created)
CREATE role IF NOT EXISTS 'role_name' ON CLUSTER default_cluster;
- Granting permissions to a role
- Granting all creation (database and table) permissions
GRANT CREATE ON *.* TO role1 ON CLUSTER default_cluster;
- Granting the permission to create tables in the test_db database
GRANT CREATE TABLE ON test_db.* TO role1;
- Granting the permission to delete all databases and tables
GRANT DROP ON test_db.* TO role1;
- Granting all creation (database and table) permissions
- Deleting a role
DROP ROLE 'role_name' ON CLUSTER default_cluster;
- Querying the permissions and roles of a user
- Querying permissions of a user
show grants for all;
- Querying permissions of a role
show grants for role1;
- Querying permissions of a user
Parent topic: ClickHouse Role Management
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot