我一直在使用 postgreSQL,尝试使用命令转储普通备份文件:
psql -U postgres DATABASE < path to file.backup
但是获取对等身份验证失败。甚至尝试将 pg_hba.conf
从 peer
更改为 md5
,但没有成功。
最佳答案
peer
表示您不是 OS 用户 postgres,同时尝试作为一个连接,
sudo su - postgres
- 然后是
psql DBNAME >file.sql
https://www.postgresql.org/docs/current/static/auth-methods.html#AUTH-PEER
The peer authentication method works by obtaining the client's operating system user name from the kernel and using it as the allowed database user name (with optional user name mapping). This method is only supported on local connections.
关于postgresql - 用户 "postgres"的对等身份验证失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44650783/