local all all md5
credentials that you have to set to local clients are able to access the database.
local all all md5
@player001 how about the ip range not required ?
Hi @Inderpreet, I also had this problem even I have installed and configured Postgresql as required but it shows the task as failure.
Please check the below steps which I performed during the installation and configuring the PostgreSQL
- sudo yum install postgresql-server postgresql-contrib
- sudo postgresql-setup initdb
- sudo systemctl enable postgresql && sudo systemctl start postgresql
- echo -n ‘BruCStnMT5’ | md5sum
- sudo -u postgres psql postgres
- CREATE USER kodekloud_joy WITH ENCRYPTED PASSWORD ‘1de08cde294b11aa10e2d39b30286c95’;
- CREATE DATABASE kodekloud_db3 OWNER kodekloud_joy;
- GRANT ALL PRIVILEGES ON DATABASE kodekloud_db3 TO kodekloud_joy;
- sudo vi /var/lib/pgsql/data/pg_hba.conf
- sudo vi /var/lib/pgsql/data/postgresql.conf
- sudo systemctl restart postgresql.service
- psql -U kodekloud_joy -d kodekloud_db3 -h 127.0.0.1 -W
Can you please check ?
@fazalmahmood this is marked
Success for you.
I did the same process as you described @fazalmahmood but it shows failed login with error message as "psql: FATAL: password authentication failed for user “kodekloud_user” . There is one thing I need to know that what to write in “postgresql.conf” and “pg_hba.conf” files or what else I need to change in the process @mmumshad @Inderpreet @player001 @kaushik .
Already described there compare with your pg_hba.conf file. You have to setup connection for local and authentication with md5 encrypted password so change peer to md5.
@rakshita I think you made mistake here
echo -n ‘BruCStnMT5’ | md5sum
you should replace BruCStnMT5 with your password as mentioned in your task and use the md5 output in following command
CREATE USER “KODEKLOUD_USER_HERE” WITH ENCRYPTED PASSWORD ‘YOUR_MD5_WILL_BE_HERE’;
and uncomment “listen_addresses” in postgresql.conf and replace existing Method with md5 in pg_hba.conf
Hope It’ll work for you
I have used my password only. And did all the configurations as you mentioned. Still not working???
You don’t need to convert the password into md5.
@rakshita Change method from ident to md5 in IPv4 local connections, below line where you changed previously