Path: API › 数据库管理

`POST /database`

获取 MySQL 服务器的运行状态变量（`SHOW GLOBAL STATUS` 结果）。

## Request body

_Required._

- `action67.request_time` (string, required) — Unix 时间戳。
- `action67.request_token` (string, required) — 按 API 概览生成的签名。
- `action67.action` (string, required) — 具体操作名称。
  - one of `"GetRunStatus"`

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "GetRunStatus"
}
```

## 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=GetRunStatus"
```

## Responses

### default

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

#### Example

```json
{
  "Aborted_clients": "33",
  "Bytes_received": "17167",
  "Bytes_sent": "39463",
  "Connections": "50",
  "Uptime": "3600",
  "Threads_connected": "2"
}
```


## GetRunStatus

获取 MySQL 服务器的运行状态变量（`SHOW GLOBAL STATUS` 结果）。

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

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `GetRunStatus` |

## 输出参数

返回 MySQL 状态变量键值对，包含连接数、查询数、流量等数百个指标。

| 常见参数 | 描述 |
|----------|------|
| Connections | 总连接次数 |
| Uptime | MySQL 运行时间（秒） |
| Bytes_received/sent | 收发字节数 |
| Com_select/insert/update/delete | CRUD 操作计数 |
| Slow_queries | 慢查询数 |
| Threads_connected | 当前连接数 |

## 示例

```json
{
    "Aborted_clients": "33",
    "Bytes_received": "17167",
    "Bytes_sent": "39463",
    "Connections": "50",
    "Uptime": "3600",
    "Threads_connected": "2"
}
```

