Path: API › 数据库管理

`POST /database`

获取指定 MySQL 服务器上的所有数据库列表。

## Request body

_Required._

- `action55.request_time` (string, required) — Unix 时间戳。
- `action55.request_token` (string, required) — 按 API 概览生成的签名。
- `action55.action` (string, required) — 具体操作名称。
  - one of `"GetDatabaseList"`
- `action55.id` (integer, required) — 数据库服务器 ID，`0` = 本地 MySQL

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "GetDatabaseList",
  "id": 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=GetDatabaseList" \
  --data-urlencode "id=<id>"
```

## Responses

### default

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

#### Example

```json
[
  [
    "information_schema"
  ],
  [
    "bt_api_test"
  ],
  [
    "mysql"
  ],
  [
    "performance_schema"
  ],
  [
    "sys"
  ]
]
```


## GetDatabaseList

获取指定 MySQL 服务器上的所有数据库列表。

- **路由**：`POST /database`
- **action**：`GetDatabaseList`
- **返回类型**：Array（二维数组）

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `GetDatabaseList` |
| id | 是 | Integer | 数据库服务器 ID，`0` = 本地 MySQL |

## 输出参数

返回二维数组，每项为 `[数据库名]`。

## 示例

### 请求

```
POST /database HTTP/1.1
Content-Type: application/x-www-form-urlencoded

request_time=1700000000&request_token=xxx&action=GetDatabaseList&id=0
```

### 响应

```json
[["information_schema"], ["bt_api_test"], ["mysql"], ["performance_schema"], ["sys"]]
```

