Advanced
Тема интерфейса

Using User Management Commands

This section describes how to use basic syntax and SQL statements to manage users.

  1. Creating a user
    CREATE USER IF NOT EXISTS name ON CLUSTER default_cluster IDENTIFIED WITH sha256_password BY 'password';
  2. Specifying the IP address
    CREATE USER name HOST IP '127.0.0.x' IDENTIFIED WITH sha256_password BY 'password';
  3. Changing a user password
    ALTER USER IF EXISTS name ON CLUSTER default_cluster IDENTIFIED WITH sha256_password BY 'password';
  4. Assigning a role to the user
    GRANT role1, role2 TO new_user ON CLUSTER default_cluster;
  5. Canceling the role assignment.
    REVOKE role1 FROM user ON CLUSTER default_cluster;
  6. Deleting a user
    DROP USER IF EXISTS 'name1'ON CLUSTER default_cluster;