Skip to content

Instantly share code, notes, and snippets.

@exkuretrol
Last active July 10, 2026 01:27
Show Gist options
  • Select an option

  • Save exkuretrol/732970e6ae39c08203eb99887c09b752 to your computer and use it in GitHub Desktop.

Select an option

Save exkuretrol/732970e6ae39c08203eb99887c09b752 to your computer and use it in GitHub Desktop.
Reset the MariaDB Root Password on Unraid

This procedure temporarily starts the MariaDB Docker container with authentication disabled, resets the root password through the container console, and then restores the normal container configuration.

Warning: Back up the MariaDB appdata/database directory before proceeding. While --skip-grant-tables is enabled, MariaDB authentication is disabled.

1. Save the existing container configuration

  1. Open the Unraid Docker page.
  2. Click the MariaDB container icon and select Edit.
  3. Temporarily change any value.
  4. Change the value back to its original setting.
  5. The greyed-out Apply button should now become clickable.
  6. Click Apply.
  7. Copy and save the displayed docker run command.

The copied command provides a backup of the current container settings, including paths, ports, environment variables, network settings, and additional parameters.

2. Stop the MariaDB container

From the Unraid Docker page, stop the MariaDB container.

3. Enable password-recovery mode

Click the MariaDB container icon and select Edit.

Enable Advanced View if the relevant fields are not visible.

Extra Parameters

Keep the Docker user option in Extra Parameters:

--user 99:100

This option appears before the image name in the generated Docker command.

On Unraid, the numeric user and group IDs map to:

  • UID 99 = user nobody
  • GID 100 = group users

Therefore:

--user 99:100

is the numeric equivalent of:

--user nobody:users

Using numeric IDs avoids user and group name-resolution differences between the Unraid host and the container.

Post Arguments

Add the following to Post Arguments:

--skip-grant-tables
--skip-networking

These arguments appear after the image name in the generated Docker command.

  • --skip-grant-tables temporarily disables MariaDB account authentication.
  • --skip-networking prevents remote database connections while authentication is disabled.

Click Apply and allow the container to start.

4. Open the MariaDB container console

  1. Open the Unraid Docker page.
  2. Click the MariaDB container icon.
  3. Select Console.

From the container console, connect to MariaDB:

mariadb -uroot

No password should be required while MariaDB is running with --skip-grant-tables.

5. Find the account and reset its password

At the MariaDB prompt, reload the privilege tables:

FLUSH PRIVILEGES;

List the available MariaDB accounts:

SELECT User, Host FROM mysql.user;

Alternatively, display each account in user@host format:

SELECT CONCAT(User, '@', Host) AS Account
FROM mysql.user;

Identify the exact root account that needs to be changed.

For example, reset the password for root@localhost:

SET PASSWORD FOR 'root'@'localhost' =
    PASSWORD('NEW_STRONG_PASSWORD');

For a root account using % as its host:

SET PASSWORD FOR 'root'@'%' =
    PASSWORD('NEW_STRONG_PASSWORD');

Replace NEW_STRONG_PASSWORD with the new password.

The username and host must exactly match an account returned by the earlier query. If multiple root accounts are used, reset each relevant account separately.

Confirm the account list again:

SELECT CONCAT(User, '@', Host) AS Account
FROM mysql.user;

Exit MariaDB:

EXIT;

Close the container console.

6. Disable password-recovery mode

  1. Open the Unraid Docker page.
  2. Click the MariaDB container icon and select Edit.
  3. Remove the following values from Post Arguments:
--skip-grant-tables
--skip-networking
  1. Leave the following value in Extra Parameters:
--user 99:100
  1. Click Apply.

Unraid will automatically stop the existing container, apply the updated configuration, and start the container normally.

Important: Do not leave --skip-grant-tables enabled after completing the password reset.

Test the new password

Open the MariaDB container console and run:

mariadb -uroot -p

Enter the new password when prompted.

If an application connects to MariaDB using the changed account, update the password in that application's configuration as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment