Skip to content

Commit a2bc573

Browse files
committed
DESC USER
1 parent ef17ec7 commit a2bc573

File tree

3 files changed

+71
-7
lines changed

3 files changed

+71
-7
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: DESC USER
3+
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.644"/>
7+
8+
Displays detailed information about a specific SQL user, including authentication type, roles, network policy, password policy, and other user-related settings.
9+
10+
## Syntax
11+
12+
```sql
13+
DESC[RIBE] USER <username>
14+
```
15+
16+
## Examples
17+
18+
```sql
19+
CREATE NETWORK POLICY my_network_policy ALLOWED_IP_LIST=('192.168.100.0/24');
20+
21+
CREATE PASSWORD POLICY my_password_policy
22+
PASSWORD_MIN_LENGTH = 12
23+
PASSWORD_MAX_LENGTH = 24
24+
PASSWORD_MIN_UPPER_CASE_CHARS = 2
25+
PASSWORD_MIN_LOWER_CASE_CHARS = 2
26+
PASSWORD_MIN_NUMERIC_CHARS = 2
27+
PASSWORD_MIN_SPECIAL_CHARS = 2
28+
PASSWORD_MIN_AGE_DAYS = 1
29+
PASSWORD_MAX_AGE_DAYS = 30
30+
PASSWORD_MAX_RETRIES = 3
31+
PASSWORD_LOCKOUT_TIME_MINS = 30
32+
PASSWORD_HISTORY = 5
33+
COMMENT = 'test comment';
34+
35+
CREATE USER eric IDENTIFIED BY '123ABCabc$$123' WITH SET PASSWORD POLICY='my_password_policy', SET NETWORK POLICY='my_network_policy';
36+
37+
DESC USER eric;
38+
39+
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
40+
│ name │ hostname │ auth_type │ default_role │ roles │ disabled │ network_policy │ password_policy │ must_change_password │
41+
├────────┼──────────┼──────────────────────┼──────────────┼────────┼──────────┼───────────────────┼────────────────────┼──────────────────────┤
42+
│ eric │ % │ double_sha1_password │ │ │ false │ my_network_policy │ my_password_policy │ NULL
43+
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
44+
```

docs/en/sql-reference/10-sql-commands/00-ddl/02-user/02-user-show-users.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
title: SHOW USERS
33
sidebar_position: 3
44
---
5+
import FunctionDescription from '@site/src/components/FunctionDescription';
6+
7+
<FunctionDescription description="Introduced or updated: v1.2.644"/>
58

69
Lists all SQL users in the system. If you're using Databend Cloud, this command also shows the user accounts (email addresses) within your organization that are used to log in to Databend Cloud.
710

@@ -14,14 +17,30 @@ SHOW USERS
1417
## Examples
1518

1619
```sql
17-
CREATE USER eric IDENTIFIED BY 'abc123';
20+
CREATE NETWORK POLICY my_network_policy ALLOWED_IP_LIST=('192.168.100.0/24');
21+
22+
CREATE PASSWORD POLICY my_password_policy
23+
PASSWORD_MIN_LENGTH = 12
24+
PASSWORD_MAX_LENGTH = 24
25+
PASSWORD_MIN_UPPER_CASE_CHARS = 2
26+
PASSWORD_MIN_LOWER_CASE_CHARS = 2
27+
PASSWORD_MIN_NUMERIC_CHARS = 2
28+
PASSWORD_MIN_SPECIAL_CHARS = 2
29+
PASSWORD_MIN_AGE_DAYS = 1
30+
PASSWORD_MAX_AGE_DAYS = 30
31+
PASSWORD_MAX_RETRIES = 3
32+
PASSWORD_LOCKOUT_TIME_MINS = 30
33+
PASSWORD_HISTORY = 5
34+
COMMENT = 'test comment';
35+
36+
CREATE USER eric IDENTIFIED BY '123ABCabc$$123' WITH SET PASSWORD POLICY='my_password_policy', SET NETWORK POLICY='my_network_policy';
1837

1938
SHOW USERS;
2039

21-
┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
22-
│ name │ hostname │ auth_type │ is_configured │ default_role │ roles │ disabled │
23-
├────────┼──────────┼──────────────────────┼───────────────┼───────────────┼───────────────┼──────────┤
24-
│ eric │ % │ double_sha1_password │ NO │ │ │ false │
25-
│ root │ % │ no_password │ YES │ account_admin │ account_admin │ false │
26-
└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
40+
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
41+
│ name │ hostname │ auth_type │ is_configured │ default_role │ roles │ disabled │ network_policy │ password_policy │ must_change_password │
42+
├────────┼──────────┼──────────────────────┼───────────────┼───────────────┼───────────────┼──────────┼───────────────────┼────────────────────┼──────────────────────
43+
│ eric │ % │ double_sha1_password │ NO │ │ │ false │ my_network_policy │ my_password_policy │ NULL
44+
│ root │ % │ no_password │ YES │ account_admin │ account_admin │ false │ NULLNULLNULL
45+
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
2746
```

docs/en/sql-reference/10-sql-commands/00-ddl/02-user/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This page provides reference information for the user and role related commands
1919

2020
## Information Retrieval:
2121

22+
- [DESC USER](01-user-desc-user.md)
2223
- [SHOW USERS](02-user-show-users.md)
2324
- [SHOW ROLES](04-user-show-roles.md)
2425
- [SHOW GRANTS](22-show-grants.md)

0 commit comments

Comments
 (0)