# A database privilege granted by hand disappears

UrbeStack sysadmin note about MariaDB. Last updated 30 Nov 2026.

Privileges granted by hand to a MariaDB user created in UrbeStack disappear after the next change or rebuild. UrbeStack sets grants from its own records, so use its commands to grant privileges you want to keep.

## Symptoms

A `GRANT` succeeds at the `mariadb` prompt, but `SHOW GRANTS` later omits the privilege. This happens the next time you change the user in UrbeStack or run `urbestack-rebuild`.

## Cause

For each database user it manages, UrbeStack applies the grants in its records to every host for that username and revokes any other grants.

A database user you create by hand with a username outside UrbeStack's records keeps its grants. The `urbestack-rebuild` command lists that user in `unknown_accounts`.

## Resolution

Set the grant through UrbeStack. This command gives the user full access to a database that belongs to the same customer.

```
urbestack-database-grant-set --name example_db --database example_shop --level full
```

Use `full`, `read-only`, or `none` for `--level`, or use `custom` with a list of privileges.

```
urbestack-database-grant-set --name example_db --database example_shop --level custom --privileges 'SELECT, INSERT'
```

Check the grants MariaDB lists for the user on `localhost`.

```
mariadb -e "SHOW GRANTS FOR 'example_db'@'localhost'"
```

If the problem persists after you follow this note, you can [open a support ticket](https://support.urbestack.com/new?type=support). Including the output of the commands you ran helps support diagnose the problem.
