Skip to content

MariaDB. Managing databases and users

This article covers basic operations on MariaDB databases and users: how to create a new database, add a user, grant or revoke access, change a password, and delete a database or user. The minimal scenario — install the module, create the first database and user, connect a site — is described in the Quick start. Here we go deeper: what each field in the dialogs means, what edge cases to watch for, and what to avoid.

Creating a database

A database is a separate storage with its own name. Inside it are tables that hold the application's data. A single MariaDB server can host any number of such storages at once; they are independent and don't see each other until you explicitly grant a user access to several at once.

Pick a meaningful name: it will appear in the site's config, in dumps, and in mysqldump command lines. If the server is going to host several projects, a prefix helps — for example, wp_blog, wp_shop, crm_main. Once you have more than a dozen databases, such prefixes make navigation noticeably easier.

  1. Open the MariaDB module and switch to the "Databases" tab.
  2. Click "Create database".
  3. Fill in the "Name" field: Latin letters, digits, and underscores, between 2 and 64 characters. If the name is already taken, matches a reserved word, or contains an invalid character, the panel will highlight an error under the field.
  4. Click "Create database".

If you leave the "Charset" and "Collation" fields empty, the database is created with the server defaults — utf8mb4 and utf8mb4_general_ci. This pair is enough for most applications: Cyrillic, CJK characters, and emoji are stored and sorted correctly out of the box.

It makes sense to expand the "Advanced settings" block in two cases:

  • you are restoring a dump from a server with a different charset or collation and want to pin exactly the same pair;
  • you need a specific collation — for example, utf8mb4_unicode_520_ci, utf8mb4_bin, or one of the language-specific collations.

After creation, the database appears in the list on the "Databases" tab with a size of zero — there is no data inside yet.

ℹ️ Info

A database on its own won't connect itself to an application. For a site to write to it, the database needs a user with access — see Creating a user and Granting access to databases below.

Deleting a database

  1. Open the MariaDB module and switch to the "Databases" tab.
  2. In the row of the database you need, click the icon with the "Delete" tooltip.
  3. Enter the database name in the confirmation field.
  4. Click "Delete".

‼️ Danger

Deleting a database is irreversible. All tables and records inside are lost permanently. Before deleting, make a backup or export the data through phpMyAdmin.

After confirmation, the database and all its data are removed from the server. Users who had access to it remain — the corresponding entry simply disappears from their list of available databases.

Creating a user

A MariaDB user is a separate account with its own password. Connecting to the server as root from applications is not the way to go: root has full privileges, and a single compromised site means a compromise of every other one. The simple rule is: each application gets its own user and its own database.

ℹ️ Info

Copy and save the password right away: once the dialog closes, the panel won't show it again. If you lose it, you can change it.

  1. Open the MariaDB module and switch to the "Users" tab.
  2. Click "Create user".
  3. Fill in the fields:
    • "Name" — Latin letters, digits, underscores, and hyphens, up to 32 characters. If the name is already taken or matches a reserved word, the panel will highlight an error under the field.
    • "Password" — between 8 and 255 characters, must include letters and digits. If you don't want to come up with one yourself, use the random password generator button next to the field.
    • "Databases" — an optional multi-select field. Select the databases the user should have access to right away. If the database you need doesn't exist yet, click the button to the right of the field — a database creation dialog opens on top, and after saving, the new database appears in the list of selected ones.
  4. Click "Create user".

💡 Tip

You can leave the "Databases" field empty — the user will be created without any database bindings. They'll be able to connect to the server, but any SELECT or INSERT will fail with a permissions error until you grant them access. This is a normal scenario when the database is going to be created later or access is granted as a separate step.

After creation, the user appears on the "Users" tab, and the row shows the databases they already have access to. These credentials are enough for an application: the username, the password, and the database name go into wp-config.php, .env, database.php, or another config — depending on the application. The server address is localhost: BeAdmin users are created bound to the local host, and remote connections are not configured.

Changing a password

⚠️ Warning

Update site configs at the same time as the password change. Already established connections are not dropped — an application that holds an open connection keeps working with the old password. But any new connection attempt (a PHP-FPM restart, a worker restart, a reconnect after a dropped link) will go through the new password check. If the site config isn't updated in advance, the application will fail at the next restart.

  1. On the "Users" tab, in the row of the user you need, click the icon with the "Change password" tooltip.
  2. Enter a new password or generate one with the button next to the field.
  3. Click "Change password".

Changing the password does not affect the user's existing access — the user-to-database links are preserved, only the password is updated. The button works for any MariaDB user on the server, regardless of whether it was created through BeAdmin or manually.

Granting access to databases

Access in MariaDB through BeAdmin is organised as user-to-database pairs. One user can work with several databases; one database can be handed out to several users. Access is granted as full access, without splitting by operation (SELECT, INSERT, UPDATE, etc.): once a user has access to a database, they can perform any operation in it.

Access is managed in the user's row on the "Users" tab — there are two icons next to each other:

  • "Grant database access" opens the grant dialog: you can select one more database for the user, or several at once. The list contains only databases the user doesn't have access to yet — already granted ones are not duplicated.
  • "Revoke database access" opens the revoke dialog: the list, conversely, contains only databases the user currently has access to. Revoking only removes the user-to-database link — the databases themselves and their content stay on the server.

The detailed scenario — with steps, behaviour for empty lists, and the link to the database creation dialog from the grant form — is in a separate article, Managing database access.

Deleting a user

Deleting a user revokes all of their MariaDB access — applications that connected under this name will lose their connection. The databases themselves and their data stay on the server; you can hand them over to another user or connect them to a new one.

Before deleting, check the configs of your sites (wp-config.php, .env, database.php, etc.). If this user is referenced there, update the files in advance, or create a new user with access to the required databases so the site doesn't end up without a connection. For details, see Managing database access.

  1. On the "Users" tab, in the row of the user you need, click the icon with the "Delete user" tooltip.
  2. Enter the username in the confirmation field.
  3. Click "Delete".

See also

BeAdmin © 2025. All rights reserved.