我们已将文件配置.pgpass
如下,以便创建数据库备份而无需输入密码
-bash-4.2$ more .pgpass
localhost:5432:postgres:ambari:bigdata
-bash-4.2$ pwd
/var/lib/pgsql
-bash-4.2$ whoami
postgres
-bash-4.2$ more .pgpass
localhost:5432:postgres:ambari:bigdata
-bash-4.2$
之后pg_dump
仍然坚持输入密码——为什么?
我哪里错了?
pg_dump -U ambari -f ambari.sql
Password: