I'm trying to access a PostgreSQL database through R. I tried the following code:
library(RPostgreSQL)
library(DBI)
drv <- dbDriver("PostgreSQL")
con = dbConnect(drv, #constructs SQL driver
host = MyHost,
port = MyPort,
dbname = MyDbname,
user = MyUser,
password = pw)
I already have PostgreSQL installed on my computer. With all my credentials being correct, I still get this Error:
Error in postgresqlNewConnection(drv, ...) :
RS-DBI driver: (could not connect [MyUser]@[MyHost] on MyDbname
any ideas what causes the problem? The same problem here has no solution yet. Thanks for your help
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)
Kasia