例如,当您通过 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