GetMysqlUser
获取指定 MySQL 服务器上所有用户及其权限详情。
- 路由:
POST /database - action:
GetMysqlUser
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetMysqlUser |
| sid | 是 | Integer | 服务器 ID,0 = 本地 |
输出参数
data 为数组,每项:
| 参数名称 | 类型 | 描述 |
|---|---|---|
| user | String | 用户名 |
| list | Array | 该用户在各主机上的权限列表 |
| list[].host | String | 主机(localhost / %) |
| list[].password | String | 是否有密码(有 / 无) |
| list[].password_last_changed | String | 密码最后修改时间 |
| list[].access_list | Array | 数据库级权限列表 |
示例
POST /database HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=GetMysqlUser&sid=0
{"status": true, "msg": "ok", "data": [
{"user": "root", "list": [{"host": "localhost", "password": "有"}]}
]}