Skip to content

获取 MySQL 用户及其允许登录的主机列表

查询指定 MySQL 服务器上所有用户及其允许登录的主机(Host),返回 user@host 格式列表。

POST
https://your-panel.example.com:8888/database
更新于 查看 Markdown

Request bodyX-WWW-FORM-URLENCODEDrequired

  • request_timestringrequired

    Unix 时间戳。

  • request_tokenstringrequired

    按 API 概览生成的签名。

  • actionGeUserHostListrequired

    具体操作名称。

  • idintegerrequired

    数据库服务器 ID(0 为本地 MySQL)

Returns

default

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

各操作详细说明

GeUserHostListaction=GeUserHostList获取 MySQL 用户及其允许登录的主机列表

查询指定 MySQL 服务器上所有用户及其允许登录的主机(Host),返回 user@host 格式列表。

  • 路由:POST /database
  • action:GeUserHostList

输入参数

参数名称 必选 类型 描述
action 是 String 固定值 GeUserHostList
id 是 Integer 数据库服务器 ID(0 为本地 MySQL)

输出参数

参数名称 类型 描述
- Array<String> 用户列表,格式 root@localhost,无数据时 null

示例

请求

POST /database HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded

action=GeUserHostList&id=0

响应

["root@localhost", "bt_api_test@%"]
Navigation

Type to search…

↑↓ navigate↵ selectEsc close