【发布时间】:2021-10-19 02:48:07
【问题描述】:
我尝试使用命令在两台PG服务器之间迁移数据,但都需要密码:
pg_dump -h localhost -U 本地用户数据库名 | psql -h remotehost -U remoteuser 数据库名
然后我得到错误:
pg_dump: [archiver (db)] connection to database "database" failed: FATAL: password authentication failed for user "postgres"
有什么办法可以解决这个问题吗?我不确定如何在命令中指定密码。
【问题讨论】:
-
您可以将密码放入
.pgpass -
@a_horse_with_no_name 谢谢。
标签: postgresql