Get your free beta license ↗
Databases · MariaDB

A database privilege granted by hand disappears

Last updated 30 Nov 2026
Summary

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

  1. 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
  2. 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'
  3. Check the grants MariaDB lists for the user on localhost.

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