Search
 
SCRIPT & CODE EXAMPLE
 

SQL

psql: FATAL: Ident authentication failed for user "postgres"

$ sudo -u postgres psql
password
Enter password: ...
...
Comment

password authentication failed for user postgres

# It's fairly simple to solve:
# follow this step:

# go to etc/postgresql/14/main --(assuming your version is 14)
# open terminal in this folder and type
# if nano not installed install first.. it's so good.

sudo nano pg_hba.conf 

# repalce all method from peer/md5/ to trust like this

local all  all			  		trust
local all  all 			  		trust
host  all  all 	127.0.0.1/32 	trust
host  all  all 	a::1/128 		trust

ctrl + s
ctrl + x

# then run 

sudo service postgresql restart

# then type

sudo -u postgres psql

# after that, type

ALTER USER postgres WITH PASSWORD 'postgres'

# now exit out of it by typing 

q

# now run again

sudo service postgresql restart


# That's all you have to do, congrats, everything will work now.
Comment

PREVIOUS NEXT
Code Example
Sql :: how to rename column in sql 
Sql :: alter table oracle 
Sql :: oracle list privileges 
Sql :: mysql update auto 
Sql :: sql if null then 0 
Sql :: oracle grant on all tables in schema 
Sql :: oracle create as select 
Sql :: mysql safe mode 
Sql :: data types sql 
Sql :: mysql select last 10 rows 
Sql :: fetch first 5 characters of the string in sql 
Sql :: oracle like case insensitive 
Sql :: how to change the value of a table in sql 
Sql :: oracle sessions_per_user limit 
Sql :: how to export table data from mysql table in sql format 
Sql :: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint 
Sql :: purge undo tablespace usage 
Sql :: view t-sql mail configuration 
Sql :: SQL Modify Column in a Table -Oracle 
Sql :: how to create new user and database postgresql in ubuntu 
Sql :: postgresql left join distinct on 
Sql :: check if table exists oracle 
Sql :: ora-01109 database not open in oracle 19c 
Sql :: django mssql backend 
Sql :: round one decimal place mysql 
Sql :: mysql show table structure 
Sql :: laravel get sql query eloquent with parameters 
Sql :: sqlite woth cmake 
Sql :: sql decimal vs float 
Sql :: how to find lowest in sql 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =