Path: API › 数据库管理

`POST /database`

获取本地 MySQL / MariaDB 的数据目录和监听端口。

## Request body

_Required._

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

## Example request

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

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

## Responses

### default

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

#### Example

```json
{
  "datadir": "/www/server/data",
  "port": "3306"
}
```

- `action63.response.default.datadir` (string, optional) — MySQL 数据目录路径
- `action63.response.default.port` (string, optional) — MySQL 监听端口


## GetMySQLInfo

获取本地 MySQL / MariaDB 的数据目录和监听端口。

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

## 输入参数

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

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| datadir | String | MySQL 数据目录路径 |
| port | String | MySQL 监听端口 |

## 示例

### 响应

```json
{"datadir": "/www/server/data", "port": "3306"}
```

