psql: error: FATAL: Peer authentication failed for user "xxxx"
psql: FATAL: Peer authentication failed for user “xxxx”
do
psql postgres -U "xxxx"
if you meet that error, the mean is
““Peer” —> 用户"xxxx"身份验证失败’”
you should take peer -> trust
you could try :
sudo vim /etc/postgresql/12/main/pg_hba.conf
!!!my psql version is 12,if you use other version,is may be other numbers. in a word, you should find your installation directory. !!!
# Database administrative login by Unix domain socket
local all postgres peer
改为(you must change all "peer")
local all postgres trust
reload配置文件
sudo /etc/init.d/postgresql reload
OK