Setting Up Database is Problematic-- Failure Authentication

Hi everyone, I am Vedat, can be said develepor-to-be of RT and I am not that good English speaker so sorry about my mistakes. I would like to ask a question related to setting up the RT`s database. I made followed each step according to ManualRequirement then Manual Installation, in each step I had some problem but somehow now I am ultra stuck so I decided to ask for help.
So in this step I got an error which says that password authentication failed such as

[root@localhost ~]# cd /opt/rt5

[root@localhost rt5]# sudo sbin/rt-setup-database --action=init
In order to create or update your RT database, this script needs to connect to your Pg instance on localhost (port ‘’) as root
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Working with:
Type: Pg
Host: localhost
Port:
Name: rt5
User: rt_user
DBA: root
Failed to connect to dbi:Pg:dbname=template1;host=localhost;client_encoding=UTF8 as user ‘root’: connection to server at “localhost” (::1), port 5432 failed: FATAL: password authentication failed for user “root”[root@localhost rt5]#

So I configured some part of the RT_SiteConfig.pm as below

DatabaseUser is the name of the database account RT uses to read and store

data. ‘rt_user’ is the default but you can change it if you like.

DO NOT use the ‘rt_admin’ superuser created in the instructions above.

Set($DatabaseUser, ‘rt_user’);

DatabasePassword is the password for DatabaseUser.

Set($DatabasePassword, ‘nabersin’);

DatabaseHost is the hostname of the database server RT should use.

Change ‘localhost’ if it lives on a different server.

Set($DatabaseHost, ‘localhost’);

DatabasePort is the port number of the database server RT should use.

undef means the default for that database. Change it if you’re not

using the standard port.

Set($DatabasePort, undef);

So whenever I try to enter the password after typing
sudo sbin/rt-setup-database --action=init
I always write that nabersin as the password but it shows me that error which I shared on the very beginning.

Could someone help me with this?

PS. This is the first time I am installing RT so its not related to upgrading.

I think you can get rid of:

Set($DatabasePort, undef);

Also are you able to login to your db manually psql -U root rt5 using that password?

Well I deleted that part ```
Set($DatabasePort, undef);

Also I changed the password and it works, I have access to db when I do it manually:

[root@localhost rt5]# psql -U root rt5
psql (13.7, server 15.0)
WARNING: psql major version 13, server major version 15.
         Some psql features might not work.
Type "help" for help.

rt5=# 

But unfortunatelly it still gives the same error... Here are my databases with privileges:

> postgres=# \list
>                                   List of databases
>    Name    |  Owner   | Encoding |   Collat> e   |    Ctype    |   Access privileges   
> > -----------+----------+----------+-------------+-------------+-----------------------
> >  postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres         +
> >            |          |          |             |             | postgres=CTc/postgres+
> >            |          |          |             |             | root=CTc/postgres
> >  root      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres         +
> >            |          |          |             |             | postgres=CTc/postgres+
> >            |          |          |             |             | rt_user=CTc/postgres +
> >            |          |          |             |             | root=CTc/postgres
> >  rt5       | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres         +
> >            |          |          |             |             | postgres=CTc/postgres+
> >            |          |          |             |             | rt_user=CTc/postgres +
> >            |          |          |             |             | root=CTc/postgres
> >  rtdb      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
> >  template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
> >            |          |          |             |             | postgres=CTc/postgres+
> >            |          |          |             |             | rt_user=CTc/postgres +
> >            |          |          |             |             | root=CTc/postgres
> >  template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
> >            |          |          |             |             | postgres=CTc/postgres+
> >            |          |          |             |             | root=CTc/postgres    +
> >            |          |          |             |             | rt_user=CTc/postgres
> >  testdb    | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
> > (7 rows)

Well in the end I decided to give privileges to all the users but still it didn't work...

Edit: Plus I tried to set up database by skipping the creation of database, but it didn't work neither...


> [root@localhost rt5]# sudo sbin/rt-setup-database --skip-create --action=init
> Working with:
> Type:	Pg
> Host:	localhost
> Port:	
> Name:	rt5
> User:	rt_user
> DBA:	rt_user (No DBA)
> Now populating database schema.
> [10329] [Tue Oct 25 14:33:16 2022] [critical]: DBD::Pg::st execute failed: ERROR:  permission denied for schema public at /opt/rt5/sbin/../lib/RT/Handle.pm line 551. (/opt/rt5/sbin/../lib/RT.pm:409)
> DBD::Pg::st execute failed: ERROR:  permission denied for schema public at /opt/rt5/sbin/../lib/RT/Handle.pm line 551.

I solved the problem by changing my DBA as postgres and it worked … PLus I had to delete the db rt5, then applied

sudo sbin/rt-setup-database --action=init