1

I have an R shiny server which also hosts a PostgreSQL Database. However, I have trouble connecting R with Postgres.

Here is my R script:

library("dplyr")
library("RPostgreSQL")
con <- dbConnect(PostgreSQL(), dbname = "___", host="localhost", port="___", user="___", password="___")

With Rscript "skript.R" I get this error:

Error in postgresqlNewConnection(drv, ...) :
  RS-DBI driver: (could not connect _____@localhost:___ on dbname "versuch1": FATAL:  Ident authentication failed for user "_____"
)
Calls: dbConnect -> dbConnect -> postgresqlNewConnection -> .Call
Execution halted

What am I doing wrong. Any hints?

nexonvantec
  • 572
  • 1
  • 5
  • 18
  • Are you able to connect through a different client using those credentials? – JNevill May 02 '18 at 14:47
  • There's a question with answers on that error message: https://stackoverflow.com/questions/2942485/psql-fatal-ident-authentication-failed-for-user-postgres – mlinth May 02 '18 at 14:53
  • @JNevill How do I connect through a different client? – nexonvantec May 02 '18 at 15:04
  • Perhaps check out that link that @mlinth suggested first. If that doesn't pan out then I was suggesting that you connect to your postgres database through another client besides R to test connectivity for the username/pass you ahve set up on your database. If you are on the linux command line you can use `psql` client, for instance. – JNevill May 02 '18 at 15:09

0 Answers0