This page explains how to create and manage users in your Managed ClickHouse® cluster.
A user or user account is a special account that allows you to interact with databases in the cluster.
You can grant users different permissions through roles and
thus efficiently control access to the data.
Users in ClickHouse® are different from DoubleCloud users.
Users in ClickHouse® only exist in a specific cluster and can perform specific actions with the cluster resources.
Sometimes they can also be referred to as database users or service users.
You can create and manage users both in the DoubleCloud console and via SQL.
However, some parameters and settings may only be available via SQL.
Select the Access control tab and then the Users tab.
Click Create user.
Enter a username, select the auth type, and enter a password.
Username and password requirements
A username must be between 2 and 128 characters long,
can contain uppercase and lowercase letters (a-Z), numbers, and dashes,
and can't start with a number.
A password must be between 8 and 128 characters long,
must contain uppercase and lowercase letters, numbers,
and special characters (-!@#$%^&*_=+:;'\"\\|/?,.`~§±()[]{}<>"),
and can only begin with a letter.
When you create a user in the console, you can choose from the following auth types:
the SHA256-encoded password, double SHA-1-encoded password, or bcrypt-encoded password.
If you need to use a different auth type, create a user via SQL.
(Optional) In Roles, select the predefined roles you want to assign to the new user.
If there are no roles in the cluster,
you can skip this step now, create a role after creating the user, and then assign it to the user.
(Optional) If you want to configure permissions for this user individually,
enable Privileges and specify grants or revokes.
Tip
It's recommended to grant privileges and apply settings to ClickHouse® users through roles
rather than individually.
With roles, you can grant a set of privileges to one or several users at the same time.
It makes it easier to manage permissions and control access.
Only grant privileges individually if you need to do so.
Privilege reference
Action: Grant permissions with this privilege or revoke them.
Tip
Revokes allow you to withdraw privileges the user already has through a role or directly.
You can also revoke a part of an existing privilege or grant a certain privilege and revoke its part.
Access type: Access type that's granted or revoked.
Databases: Apply the privilege to all databases or one specific database.
Tables: Apply the privilege to all tables or one specific table.
Columns Apply the privilege to all columns or specific columns.
Grant option: Give the permission to execute the GRANT query
and grant privileges of the same or lower scope.
(Optional) In Settings, configure additional settings for the user.
By default, the GRANT statement appends privileges.
If you want to replace them, add the WITH REPLACE OPTION clause.
If you want to allow the user to grant privileges of the same or lower scope to other users,
use WITH GRANT OPTION.
Tip
Roles and privileges are related, but they serve different purposes.
When you give privileges to a specific user, you grant them certain permissions individually.
With roles, you can grant a set of privileges to one or several users at the same time.
Granting permissions through roles makes it easier to manage them than through assigning them individually.