# Databases Management endpoints (Admin API)

> 5 FeatherPanel Admin API endpoints from admin/databases-management.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/admin/databases-management/

Defined in [`backend/app/routes/admin/databases-management.php`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/databases-management.php). Authentication used here: **Admin**. Read [Authentication](https://featherpanel.com/docs/api/authentication/) for how to send credentials and [Rate limits and errors](https://featherpanel.com/docs/api/rate-limits-and-errors/) for the response envelope.

Paths, methods, permissions and rate limits come from the route file. Summaries, parameters and response codes come from the OpenAPI annotations on the controllers; endpoints without annotations show only what the route file declares.

## Endpoints

### GET `/api/admin/databases/management/status`

- Auth: Admin
- Permission: `admin.databases.view`
- Route name: `admin-databases-management-status`
- Controller: [`DatabaseManagmentController::status`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/DatabaseManagmentController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/databases-management.php#L25)

**Get database status** Retrieve comprehensive database status information including MySQL version, uptime, connection statistics, and performance metrics.

| Response `data` field | Type | Description |
| --- | --- | --- |
| `engine` | string | Database engine type |
| `version` | string | MySQL version |
| `uptime_seconds` | integer | Database uptime in seconds |
| `threads_connected` | integer | Number of currently connected threads |
| `threads_running` | integer | Number of currently running threads |
| `connections_total` | integer | Total number of connections made |
| `aborted_connects` | integer | Number of aborted connection attempts |
| `queries_total` | integer | Total number of queries executed |
| `questions_total` | integer | Total number of questions (statements) executed |
| `qps` | number | Queries per second (calculated) |
| `bytes_received` | integer | Total bytes received from clients |
| `bytes_sent` | integer | Total bytes sent to clients |

```bash
curl -X GET "$PANEL_URL/api/admin/databases/management/status" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Database status retrieved successfully · `401` Unauthorized · `403` Forbidden - Insufficient permissions · `500` Internal server error - Failed to fetch database status

### POST `/api/admin/databases/management/migrate`

- Auth: Admin
- Permission: `admin.databases.manage`
- Route name: `admin-databases-management-migrate`
- Controller: [`DatabaseManagmentController::migrate`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/DatabaseManagmentController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/databases-management.php#L35)

**Run database migrations** Execute pending database migrations from the storage/migrations directory. This will run all SQL migration files that haven't been executed yet.

| Response `data` field | Type | Description |
| --- | --- | --- |
| `exit_code` | integer | Exit code (0 for success, 1 for errors) |
| `output` | string | Migration execution log with detailed output |

```bash
curl -X POST "$PANEL_URL/api/admin/databases/management/migrate" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Plugin events: [`featherpanel:admin:database_management:migrations:executed`](https://featherpanel.com/docs/plugins/events/database-management/#migrations-executed)

Responses: `200` Migrations executed successfully · `401` Unauthorized · `403` Forbidden - Insufficient permissions · `500` Internal server error - Failed to run migrations

### POST `/api/admin/databases/management/install-phpmyadmin`

- Auth: Admin
- Permission: `admin.databases.manage`
- Route name: `admin-databases-management-install-phpmyadmin`
- Controller: [`DatabaseManagmentController::installPhpMyAdmin`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/DatabaseManagmentController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/databases-management.php#L46)

**Install phpMyAdmin** Download and install phpMyAdmin to the public directory. This will download the latest version, extract it, configure it, and install themes.

| Response `data` field | Type | Description |
| --- | --- | --- |
| `message` | string | Success message |
| `already_installed` | boolean | Whether phpMyAdmin was already installed |

```bash
curl -X POST "$PANEL_URL/api/admin/databases/management/install-phpmyadmin" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` phpMyAdmin installed successfully · `401` Unauthorized · `403` Forbidden - Insufficient permissions · `500` Internal server error - Failed to install phpMyAdmin

### GET `/api/admin/databases/management/phpmyadmin/status`

- Auth: Admin
- Permission: `admin.databases.view`
- Route name: `admin-databases-management-phpmyadmin-status`
- Controller: [`DatabaseManagmentController::checkPhpMyAdminStatus`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/DatabaseManagmentController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/databases-management.php#L57)

**Check phpMyAdmin installation status** Check if phpMyAdmin is currently installed.

| Response `data` field | Type | Description |
| --- | --- | --- |
| `installed` | boolean | Whether phpMyAdmin is installed |

```bash
curl -X GET "$PANEL_URL/api/admin/databases/management/phpmyadmin/status" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` phpMyAdmin installation status retrieved successfully · `401` Unauthorized · `403` Forbidden - Insufficient permissions

### DELETE `/api/admin/databases/management/phpmyadmin`

- Auth: Admin
- Permission: `admin.databases.manage`
- Route name: `admin-databases-management-delete-phpmyadmin`
- Controller: [`DatabaseManagmentController::deletePhpMyAdmin`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/DatabaseManagmentController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/databases-management.php#L67)

**Delete phpMyAdmin** Remove phpMyAdmin installation from the public directory.

| Response `data` field | Type | Description |
| --- | --- | --- |
| `message` | string | Success message |

```bash
curl -X DELETE "$PANEL_URL/api/admin/databases/management/phpmyadmin" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` phpMyAdmin deleted successfully · `401` Unauthorized · `403` Forbidden - Insufficient permissions · `404` phpMyAdmin is not installed · `500` Internal server error - Failed to delete phpMyAdmin
