/databases/users/{name}/adopt
Assign an existing MariaDB user name to a customer as a database user
databasesallOnly administrators can call this operation. Set user to the customer who will own the database user for a MariaDB user name created outside UrbeStack. UrbeStack keeps the account's mysql_native_password hash so applications that sign in with the account keep working. It records grants on the customer's databases as full when the grant includes every privilege on the database, read-only when it includes only SELECT and SHOW VIEW, and custom for any other list of privileges. MariaDB treats an unescaped underscore in a grant as a wildcard. UrbeStack records such a grant for the database whose name matches the name in the grant literally. UrbeStack then applies the recorded grants to every existing account with that name and creates any missing localhost, 127.0.0.1 and ::1 accounts with the same hash. It creates the ::1 account only if IPv6 loopback is available. The operation returns the database user in user.
The API returns 400 if user is missing, is empty or does not identify a customer. It also returns 400 if name is reserved for phpMyAdmin sign-on, matches the name of one of MariaDB's own accounts (root or mysql), or falls outside the allowed format of 1 to 64 ASCII letters, digits or underscores. It returns 404 if MariaDB has no account with that name. It returns 409 if UrbeStack already has a database user with that name, if any account lacks a mysql_native_password hash or has more than one authentication method, or if passwords or grants differ across hosts. It also returns 409 if any account has a global privilege, GRANT OPTION, a role, a PROXY privilege, or a grant on a table, column, routine, name pattern, one of MariaDB's own databases or a database the customer does not own. It also returns 409 if two grants on the same host name the same database and differ in privileges, with the underscore escaped in only one grant. On a 409, the API lists every reason and makes no changes. To grant privileges on an unowned database, first adopt it with POST /databases/{name}/adopt.
As a command
Run as root on the serverParameters
namepath ·DatabaseNameRequiredRequest body
JSON· 1 fielduserUsernameRequiredExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/databases/users/alice/adopt" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"user": "alice"
}'201 Created{
"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
12 errors, each a status and a sentence400--name is required400A <what> name is 1 to 64 letters, digits or underscores400A custom grant needs a privilege list of names separated by commas: SELECT, INSERT, ...400A name beginning with <SIGNON_PREFIX> is the panel's own: its phpMyAdmin users400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400The level is full, read-only or custom400Username '<value>' is reserved400user is required: the customer the database user is given to401Authentication required404MariaDB has no account named <name>409<name> was not adopted: 409Database user <name> already existsChange log
1 change since publication, newest first0.2.371 Dec 20260.2.3630 Nov 2026urbestack.com/docs/api/post-databases-users-name-adopt/