0

例如,当您通过 RPostgreSQL 连接到 PostgreSQL 时,我会执行以下操作。

m <- dbDriver("PostgreSQL")
con <- dbConnect(m, host = "localhost", user= "postgres", password="admin", 
dbname = "postgres")

但是如果你想连接到服务器中的 postgreSQL,我不知道该怎么做。我会做以下事情:

m <- dbDriver("PostgreSQL")
con <- dbConnect(m, host = "10.100.100.10", port = "5432", user= "postgres", 
                 password="admin", dbname = "postgres")

这给了我这个错误:

postgresqlNewConnection(drv, ...) 中的错误:RS-DBI 驱动程序:(无法在 dbname "postgres" 上连接 postgres@10.100.100.10

4

1 回答 1

3

您(或任何管理服务器的人)需要允许从另一台机器通过 tcp/ip 进行访问——默认情况下这是关闭的。参见例如

于 2015-08-04T14:31:18.277 回答