我已经在Ubuntu服务器上安装了PostgreSQL,并且正尝试使用远程MacBook上的PGAdmin连接到该服务器。
我创build了一个SSH隧道 –
macbook:~postgres$ ssh -L 5423:localhost:5432 [email protected]
而且我可以按预期在macbook上使用psql进行连接 –
macbook:~ me$ psql -U postgres -p 5423 -h localhost ... postgres=#
在PGAdminIII的“新服务器注册”窗口中,input以下凭据 –
Name - MyServer Host - localhost Port - 5423 Maintenance DB - postgres Username - postgres Password - <remote_postgres_password>
但是连接失败 –
Error connecting to the server: FATAL: password authentication failed for user "postgres"
不知道这里发生了什么,这似乎是我用于psql相同的凭据。
我的pg_hba.conf文件只有以下几行 –
# Database administrative login by Unix domain socket local all postgres peer # "local" is for Unix domain socket connections only local all all peer # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5
检查是否更改您的postgres本地线路信任(而不是同行)工程。