# PATCH /databases/users/{name}

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the databases group.

Change a database user's password

- Who may call it: administrator, reseller, customer
- Token scope, any of: databases, all
- Answers: 200 OK

UrbeStack changes the password for every MariaDB account with the given name, including accounts for hosts added directly in MariaDB. It recreates missing local accounts and reapplies the recorded grants across all accounts, removing extra privileges granted directly in MariaDB. The response returns the updated database user in user.

The API returns 400 for a name outside the allowed format of 1 to 64 ASCII letters, digits, or underscores. A missing database user or one outside the caller's permitted accounts returns 404.

## As a command

- [urbestack-database-user-set](https://urbestack.com/docs/commands/urbestack-database-user-set.md): Changes a database user's password for every MariaDB host with an account under that name, including hosts added by hand.

## Parameters

- `name` (path, DatabaseName, required)

## Request body

JSON.

- `password` (string, up to 128 characters, required)

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X PATCH "$API/databases/users/alice" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "password": "Sup3r-Secret-Passphrase"
  }'
```

Response, 200 OK:

```
{
  "user": {
    "created_at": "2026-09-09T10:15:00Z",
    "grants": [
      {
        "database": "alice_shop",
        "level": "full",
        "privileges": "text"
      }
    ],
    "id": 1,
    "name": "alice",
    "other_hosts": [
      "text"
    ],
    "updated_at": "text",
    "user": "alice",
    "user_id": 2
  }
}
```

## Errors

- 400: --name is required
- 400: A <what> name is 1 to 64 letters, digits or underscores
- 400: A new password is required
- 400: Invalid password: 8 to 128 printable characters
- 401: Authentication required
- 404: No such database user: <name>
