Using User Management Commands
This section describes how to use basic syntax and SQL statements to manage users.
- Creating a userCREATE USER IF NOT EXISTS name ON CLUSTER default_cluster IDENTIFIED WITH sha256_password BY 'password';
- Specifying the IP addressCREATE USER name HOST IP '127.0.0.x' IDENTIFIED WITH sha256_password BY 'password';
- Changing a user passwordALTER USER IF EXISTS name ON CLUSTER default_cluster IDENTIFIED WITH sha256_password BY 'password';
- Assigning a role to the userGRANT role1, role2 TO new_user ON CLUSTER default_cluster;
- Canceling the role assignment.REVOKE role1 FROM user ON CLUSTER default_cluster;
- Deleting a userDROP USER IF EXISTS 'name1'ON CLUSTER default_cluster;
Parent topic: ClickHouse User Management