Using User Management Commands
This section describes how to use basic syntax and SQL statements to manage users.
- Creating a user
- Use CREATE USER command to create a Doris user (without a role).CREATE USER 'Jack' IDENTIFIED BY 'password';
Table 1 Parameters Parameter
Description
Jack
Username
password
Password of the created user
NoteYou can run the command to specify an IP address.
CREATE USER 'jack02' @'192.168.%' identified by '123456' DEFAULT ROLE 'default_role'; - Use CREATE USER command to create a Doris user (without the default role assigned).CREATE USER 'jeo' IDENTIFIED BY 'password' DEFAULT ROLE 'default_role';
- Use CREATE USER command to create a Doris user (without a role).
- Changing a user password
Use the ALTER USER command to change the password of a user.
ALTER USER 'Jack' IDENTIFIED BY "password"; - Assigning a role to the user
- Assign a role to the user.GRANT 'role1','role2' TO 'jack'@'%';
Table 2 Parameters Parameter
Description
role
Created role
jack
Name of the new user
- Revoke the role assigned to the user.REVOKE 'role1' FROM 'candy';
- Assign a role to the user.
- Delete a user.DROP USER'Jack';
Parent topic: Doris User Management