Moonlight Docs v2.0 Help

Acquiring admin perms via the db

If you locked yourself out or just want to give another account admin permissions without using the permission editor in moonlight, you can use the steps in the following guide:

Before you start

Before you start, make sure you have a shell session as root and moonlight installed successfully

Using the db to set admin permissions

Describe what the user will learn and accomplish in the first part, then write a step-by-step procedure but on a real-world example.

  1. First, you need to find out your database root password, you can do this by executing:

    docker inspect moonlight_db | grep ROOT_PASSWORD

    The result should be smth like this:

    "MYSQL_ROOT_PASSWORD=yOuRFaNcYRoOtPaSwOrD"
  2. After that you want to log in to your database by executing:

    docker exec -it moonlight_db mysql -u root -p

    It will ask you for your password, enter the password you got from the step above

  3. Then change the database to the database moonlight is using with:

    USE moonlight;
  4. And for the final step, execute the following command replacing the username "testyowo" with the username of the account:

    UPDATE Users SET Permissions = 9999 WHERE Username = "testyowo";
  5. Then exit with:

    exit;

    Refresh the page and you should have full permissions

Last modified: 15 September 2024