[Solved] Gitea Installation Fails with Database Error

I used dietpi-software to install Gitea, and that seemed to go fine. Next in the instructions posted here:

I went to 192.168..**:3000 and the “Install Configuration” page came up for Gitea. So far so good. In the above instructions it says very specifically that you should change only certain fields. However, I’m fine with the “gitea” user for the mariadb database and the password field was left blank. No mater what I do I can’t leave the fields as they are, or put a password into the blank password without getting the following error with either “(using password: YES or NO)” depending if I put a password into there or not.

Error Message “Database setting is invalid: Error 1045: Access denied for user ‘gitea’@‘localhost’ (using password: YES)”

I’m guessing that I don’t have mariadb properly configured, but that was not part of the instructions so I’m a bit lost as to what to do as this point. I’m not sure if the dietpi scripts automatically created a user and password in mariadb or I still need to do that. I’m sure this is a noob question (I’m new to the world of website databases), and I tried searching and reading the documentation for Gitea, but they don’t reference database errors. I tried reading some documentation about mariadb, but that references a root user and password, which I didn’t set up when the dietpi script installed and configured everything so I’m unsure if I’m supposed to use my system root user and password for those instructions.

Thanks for any help you are able to offer.

Check again the link: You need to enter/adjust the database info as stated there. The database has already been configured/created for you with database and user name both gitea. The password dietpi is just a placeholder for the global software password that you choose either via dietpi.txt before first boot of DietPi, or otherwise you were asked during first run setup for it or for older systems during one of the past updates. Host must be localhost, since MariaDB and Gitea are on the same machine.

[See My Next Post - It Was A Password Issue]

Thanks, MichaIng, for giving me some direction. I opened the “Install and Configuration” site again on my network. I left the gitea as the user, and for the password. I did not specify anything in dietpi.txt before I installed and booted Dietpi for the first time. So I used the password that I use to install all my software like when I “sudo apt install” something. Is there a different password that you set other than the ones you set for the user dietpi and root? If so perhaps I misplaced that password.

I checked the “host” and you said it had to be set to localhost. It was set to “” which should be localhost. I also tried putting into the host field “localhost:3306” but that didn’t work either. I am at a loss as to what I’m doing wrong. Perhaps the password is wrong, but I have installed ProFTP and other software using “sudo apt install” without any issue on my install of Dietpi. Dietpi has also updated to the newest version without issue too. Any other ideas what I might have missed?

Thanks for helping a new user, I appreciate your help and patience.

I could kick myself. MichaIng, you were right. I messed up the password. I looked through my Dietpi install notes and discovered what was called a “Global Password”. This was the password your were referring to. I kept trying to use the passwords for my user “dietpi” and “root” and those weren’t working. When I used the “Global Password” it finished the install, and I’m up and running now. Thank you so much for your patience.

I’m getting the exact same error on Dietpi v8.12.1 (yes I know I’m resurrecting an old thread, but the issues are very similar).

The solution (as described above) requires knowing the global password, which I thought I knew… but didn’t. So I did a manual workaround, and I’m posting here for anyone who also faces this issue:

## log in to msql as root without pass
sudo mysql -u root

## Check that the database "gitea" is there
MariaDB [(none)]> show tables;

## Check that the user "gitea" is also there
MariaDB [(none)]> SELECT User, Host, authentication_string 
                  FROM mysql.user;

## Change the password for "gitea" to something new
MariaDB [(none)]> ALTER USER 'gitea'@'localhost' IDENTIFIED BY 'mypass123'; 

## Quit mysql
MariaDB [(none)]> quit;  

After that, you should be able to complete the http://192.168.x.x:3000/ log in, by specifying the table as “gitea”, the user as “gitea”, and the password as whatever you set it to (mypass123).

@mtekman thank you for posting about this.

I have moved away from Dietpi because I had SD corruption happen twice after doing the dietpi update on a Raspberry Pi 1 B with 512mb of RAM. Where as I have been running Raspberry OS with unattended upgrades for over a year without any SD corruption. I never looked into why the Dietpi update tended to corrupt the SD cards on my old Pi’s.

However, Dietpi is an amazing project, and I should really look into giving it another try on either an unused Raspberry Pi 1 or on x86 hardware that I have lying around in my homelab. Your post provides a fix for an issue that I had, and reminded me that Dietpi in my homelab would be useful.

I moved away from Gitea as well, and chose to simply run git on a RPi 1 that serves as my ‘private’ git server using bare repositories. Since this gives me all the functionality I need without the overhead of running a web app.

Thanks for peeking my interest again.

1 Like

On an update, DietPi is not doing anything different than running apt update && apt upgrade, which is Debian standard way to update packages. Btw, DietPi offers the option as well to update apt packages once a day automatically (without the need of additional software).