Path: API › 数据库管理

`POST /database`

设置 MySQL 的超时和连接相关配置参数。

## Request body

_Required._

- `action71.request_time` (string, required) — Unix 时间戳。
- `action71.request_token` (string, required) — 按 API 概览生成的签名。
- `action71.action` (string, required) — 具体操作名称。
  - one of `"SetTimeOut"`
- `action71.interactive_timeout` (integer, optional) — 交互连接超时（秒）
- `action71.wait_timeout` (integer, optional) — 非交互连接超时（秒）
- `action71.expire_logs_days` (integer, optional) — 二进制日志过期天数
- `action71.default_password_lifetime` (integer, optional) — 密码有效期（天），`0` = 永不过期

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "SetTimeOut",
  "interactive_timeout": 0,
  "wait_timeout": 0,
  "expire_logs_days": 0,
  "default_password_lifetime": 0
}
```

## Code samples

### cURL（填写面板地址与签名）

```curl
curl --request POST \
  --url "https://your-panel.example.com:8888/database" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "request_time=<Unix时间戳>" \
  --data-urlencode "request_token=<按 API 概览生成的签名>" \
  --data-urlencode "action=SetTimeOut"
```

## Responses

### default

接口响应，业务状态见下方详细说明。

#### Example

```json
{
  "status": true,
  "msg": "设置成功！"
}
```

- `action71.response.default.status` (boolean, optional) — 请求结果，`true` 表示成功
- `action71.response.default.msg` (string, optional) — 提示信息


## SetTimeOut

设置 MySQL 的超时和连接相关配置参数。

- **路由**：`POST /database`
- **action**：`SetTimeOut`

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `SetTimeOut` |
| interactive_timeout | 否 | Integer | 交互连接超时（秒） |
| wait_timeout | 否 | Integer | 非交互连接超时（秒） |
| expire_logs_days | 否 | Integer | 二进制日志过期天数 |
| default_password_lifetime | 否 | Integer | 密码有效期（天），`0` = 永不过期 |

## 示例

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| status | Boolean | 请求结果，`true` 表示成功 |
| msg | String | 提示信息 |

```json
{"status": true, "msg": "设置成功！"}
```

