OK looks like the root user in MariaDB is created like this:
MariaDB [(none)]> SHOW CREATE USER 'root'@'localhost';
+----------------------------------------------------------------------------------------------------+
| CREATE USER for root@localhost |
+----------------------------------------------------------------------------------------------------+
| CREATE USER `root`@`localhost` IDENTIFIED VIA mysql_native_password USING 'invalid' OR unix_socket
Password = The same as your root login password, default is dietpi
@AarafGaming to use root user you would need to set a password for it, but it’s even better to create an own user for Forgejo.
Or maybe you can even use SQLite, should be enough if you just run your personal Forgejo instance.
You can do this by installing SQLite via dietpi-software (and maybe uninstall MariaDB if you don’t need it), forgejo has it’s own path at /mnt/dietpi_userdata/forgejo where you can store the SQlite db.
In the Forgejo setup, just choose SQLite and as path /mnt/dietpi_userdata/forgejo/data/forgejo.db.
MariaDB root access to manage (MariaDB) users and databases.
Forgejo’s own MariaDB database and account, which both is named “forgejo”.
You must never give any software root access to MariaDB, and luckily it is prevented by default with the UNIX user socket authentication module: No one but the UNIX root user can login as root to MariaDB.
Maybe our first run docs are ambiguous: Cloud and Backup Systems Software Options - DietPi.com Docs
It lists only those fields which need to be changed in the setup dialog. The database name and user fields should be prefilled with “forgejo”, which is correct.
Ok, but for what is then the mariadb root password, which is listed in the docs, when nobody can use it? Unix user root does not need it and any other user can not login as root anyways, and it’s also set as invalid:
CREATE USER `root`@`localhost` IDENTIFIED VIA mysql_native_password USING 'invalid' OR unix_socket
Anyways, @AarafGaming I tested it again, with MariaDB, and indeed it was working with my software password and the user forgejo (and the other settings mentioned in our docs)
Indeed, the MariaDB docs are wrong, I guess copy&pasted from the old phpBB docs, from ancient times when MySQL root access was still possible via password.
Nowadays: When calling the mariadb command as UNIX root user, it logs in as MariaDB root user automatically, without any password needed. But since there is not password, it is not possible to login with this account as any other UNIX user. This can/should never be used for anything else than creating new MariaDB users and databases for 3rd party software to use, like creating the forgejo user and database, for the Forgejo service. dietpi-software does this automatically, of course.