# Change database of a web hosting package

> Change the description of a database, give it a new password, or have manitu forget the password.

- Effect: Write - Changes the account. Agents ask first.
- Idempotent: no
- Stability: beta
- MCP tool: `manitu_webhosting_web_database_set` on https://mcp.manitu.de/mcp
- REST: `POST https://api.manitu.de/v1/webhosting/web/database/set`
- Needs: `service_webhosting`
- Page: /reference/webhosting/web/database/set/

**Changes the account. Agents say what will happen and wait for an explicit yes before calling it.**

## MCP tool

`manitu_webhosting_web_database_set`

### Description for the model

Changes a database of a web hosting package of the manitu customer account this connection works in, by site_id and database_id from manitu_webhosting_web_database_list. Only the fields given change: description; password_action regenerate - manitu sets a new password on the database server, and every program that connects with the old one (CMS, shop) stops working until it is changed there too -, or forget - manitu no longer keeps the password (the database keeps it; dumps and copies are not possible until a new one). The new password is NOT given here (secrets_withheld): the customer finds it in the customer panel. Refused with a conflict when the package cannot be changed now (not_configurable). Ask the customer for an explicit yes first, naming what stops working.

### Arguments

- `site_id` (integer | string, required) - The site_id from manitu_webhosting_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `database_id` (integer | string, required) - The database_id from manitu_webhosting_web_database_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `description` (string | null) - The customer's description, for his own overview. Left out: unchanged (set) or none (create); null or empty: none. (maxLength `1024`)
- `password_action` (string) - regenerate: a new password, made by manitu; forget: manitu no longer keeps the password. (one of `"regenerate"`, `"forget"`)

### Example

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "manitu_webhosting_web_database_set",
    "arguments": {
      "site_id": 12345,
      "database_id": 12345
    }
  }
}
```

## REST

`POST https://api.manitu.de/v1/webhosting/web/database/set`

### Authentication

One of `X-API-Key`, `Authorization: Bearer …` - never more than one in a request.

### Request body

JSON; unknown fields are refused.

- `site_id` (integer | string, required) - The site_id from manitu_webhosting_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `database_id` (integer | string, required) - The database_id from manitu_webhosting_web_database_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `description` (string | null) - The customer's description, for his own overview. Left out: unchanged (set) or none (create); null or empty: none. (maxLength `1024`)
- `password_action` (string) - regenerate: a new password, made by manitu; forget: manitu no longer keeps the password. (one of `"regenerate"`, `"forget"`)

### Response

In `data`; the rest of the body as on every call.

- `database_id` (integer, required) - The database - what the other database tools take.
- `server_type` (string | null, required) - The kind of database server: mariadb, mysql or postgres; null if it cannot be told right now. (one of `"mariadb"`, `"mysql"`, `"postgres"`, `null`)
- `hostname` (string, required) - The database server to connect to - from the web hosting package's own scripts.
- `name` (string, required) - The name of the database (db<number>).
- `username` (string, required) - The user to connect with (u<number>).
- `description` (string | null, required) - What the customer wrote about it (his description), null if nothing - not its name or user name.
- `password_stored` (boolean, required) - manitu still knows the password. false: the customer had it forgotten - the database keeps it, dumps and copies need a new one (set with password_action regenerate).
- `table_count` (integer | null, required) - How many tables it has, as last counted; null if never counted.
- `data_size_mb` (integer | null, required) - How much data and indexes it holds in MB (rounded down), as reported by the database server when last counted; the files on disk can be larger. null if never counted.
- `counted_at` (string | null, required) - When table_count and data_size_mb were counted. (format `date-time`)
- `created_at` (string | null, required) - When it was created. (format `date-time`)
- `password` (string | null, required) - The password - a secret; null where it is withheld (secrets_withheld) or not stored (password_stored).
- `secrets_withheld` (boolean, required) - The password is left out here (an answer to an agent) - the customer finds it in the customer panel.

### Statuses

- `200` Success.
- `400` The request does not match the declared input schema.
- `401` No credential was presented, or it was not recognised.
- `403` The credential is not permitted to use this operation.
- `500` The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.
- `503` The channel this operation forwards through is unavailable.

### Example

```sh
curl -X POST 'https://api.manitu.de/v1/webhosting/web/database/set' \
  -H 'X-API-Key: $API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"site_id":12345,"database_id":12345}'
```

## Example result

```json
{
  "database_id": 12345,
  "server_type": "mariadb",
  "hostname": "server.example.com",
  "name": "example.com",
  "username": "string",
  "description": "Example",
  "password_stored": true,
  "table_count": 1,
  "data_size_mb": 1,
  "counted_at": "2026-10-23T12:00:00+02:00",
  "created_at": "2026-10-23T12:00:00+02:00",
  "password": "correct-horse-battery",
  "secrets_withheld": true
}
```
