> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# SHOW PROPERTY

> SHOW PROPERTY displays properties of a user, including the maximum number of connections, the default catalog, and the default database.

## 功能

SHOW PROPERTY 用于显示用户的属性，包括最大连接数、密码策略、默认 Catalog 和默认数据库。

**Tip**

当前用户可以查询自己的 property。但只有拥有 `user_admin` 角色的用户才可以查看其他用户的 property。

**Info**

如需设置 `database`、`catalog` 或 `PASSWORD_POLICY` 等属性，请使用带 `SET PROPERTIES` 子句的 [ALTER USER](/documents/cn/4.2/sql-reference/sql-statements/account-management/ALTER_USER.md) 命令。
对于 `max_user_connections`，可以使用 `SET PROPERTY` 语法。

## 语法

```SQL theme={null}
SHOW PROPERTY [FOR 'user_name'] [LIKE '<property_name>']
```

## 参数说明

| **参数** | **必选** | **说明** |
| - | - | - |
| user\_name | 否 | 用户名称。如不指定，默认查看当前用户的最大连接数。 |
| property\_name | 否 | 用户属性名。 |

## 示例

示例一：查看当前用户的属性。

```Plain theme={null}
SHOW PROPERTY;

+----------------------+-----------------+
| Key                  | Value           |
+----------------------+-----------------+
| max_user_connections | 1024            |
| PASSWORD_POLICY      |                 |
| catalog              | default_catalog |
| database             |                 |
+----------------------+-----------------+
```

示例二：查看用户 `jack` 的属性。

```SQL theme={null}
SHOW PROPERTY FOR 'jack';
```

```Plain theme={null}
+----------------------+------------------+
| Key                  | Value            |
+----------------------+------------------+
| max_user_connections | 100              |
| PASSWORD_POLICY      | pwd_policy_1     |
| catalog              | default_catalog  |
| database             | sales_db         |
+----------------------+------------------+
```

示例三：使用 `LIKE` 过滤查看特定属性。

```SQL theme={null}
SHOW PROPERTY FOR 'jack' LIKE 'PASSWORD_POLICY';
```

返回信息如下：

```Plain theme={null}
+-----------------+--------------+
| Key             | Value        |
+-----------------+--------------+
| PASSWORD_POLICY | pwd_policy_1 |
+-----------------+--------------+
```

## 相关操作

如要设置用户属性，请参见 [ALTER USER](/documents/cn/4.2/sql-reference/sql-statements/account-management/ALTER_USER.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.