Have you initialize the PostgreSQL DB using,
sudo postgresql-setup initdb
If not then you need to first initialize the DB.
Secondly, you need to login Postgresql using
sudo -u postgres psql
After login you need to create the user and database and grant the permission.
Also, you need to just change only one configuration line from /var/lib/pgsql/data/pg_hba.conf
local all all peer to local all all md5
After that you need to restart the postgresql service.
@AkshayT thanks for replying. Yes, I did initialize the database. And did the necessary configuration on the pg_hba.conf file and restarted the service.
Thanks @Tej-Singh-Rana for replying. Is that the case and does it really mater? Is name of a database case sensitive? I donât know that can be, but it will be very pity if I miss it because of it.
You have to make a changes in pg_hba.conf file of postgresql. In local connection column, change peer to md5. Donât change in replication connection.
Please post your pg_hba.conf file here.
Or have u run this command while creating the user.
create user kodekloud_gem with encrypted password âksH85Ujhubâ
Please check or else you reset the password again and run above command.