psql: FATAL: Peer authentication failed for user “postgres“
psql: FATAL: Peer authentication failed for user "postgres"
执行命令
createdb mydb -U postgres
出现了以上错误,其实这说的也很明白了。
“Peer” —> 用户”postgres”身份验证失败’
编辑pg_hba.conf文件
sudo gedit /etc/postgresql/9.1/main/pg_hba.conf
Database administrative login by Unix domain socket
local all postgres peer
改为
local all postgres trust
重新加载配置文件
sudo /etc/init.d/postgresql reload
is OK
还没有评论,来说两句吧...