无法使用RPostgreSQL连接到R上的Amazon PostgreSQL RDS数据库

编程入门 行业动态 更新时间:2024-10-17 22:19:15
本文介绍了无法使用RPostgreSQL连接到R上的Amazon PostgreSQL RDS数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在RStudio上使用R并使用软件包RPostgreSQL连接到我的Amazon RDS PostgreSQL数据库时遇到问题。

I am having trouble connecting to my Amazon RDS PostgreSQL database using R on RStudio and using the package RPostgreSQL.

我正在运行:

library("RPostgreSQL") drv <- dbDriver("PostgreSQL") con <- dbConnect(drv, dbname="mydbname", host="........us-west-2.rds.amazonaws", port=5432, user="myuser", password="mypassword")

运行此行后,出现错误:

After running this line, I get the error:

postgresqlNewConnection(drv,...)中的错误:RS-DBI驱动程序:(是否无法连接 myuser @。 ....... us-west-2.rds.amazonaws在 dbname mydbname上)

Error in postgresqlNewConnection(drv, ...) : RS-DBI driver: (could not connect myuser@.........us-west-2.rds.amazonaws on dbname "mydbname" )

请注意,我具有正确的dbname,主机,端口,用户和密码,因为我能够使用pgAdmin3连接到Amazon数据库

Note that I have the correct dbname, host, port, user and password because I am able to connect to the Amazon database using pgAdmin3

这是我的会话信息:

R version 3.3.0 (2016-05-03) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.11.5 (El Capitan) locale: [1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] RPostgreSQL_0.4-1 DBI_0.4-1 dplyr_0.4.3 knitr_1.13 rbokeh_0.4.2 [6] miniUI_0.1.1 shiny_0.13.2 loaded via a namespace (and not attached): [1] Rcpp_0.12.5 formatR_1.4 highr_0.6 pryr_0.1.2 [5] plyr_1.8.4 tools_3.3.0 digest_0.6.9 jsonlite_0.9.22 [9] evaluate_0.9 gtable_0.2.0 lattice_0.20-33 datasummary_0.2.0 [13] yaml_2.1.13 parallel_3.3.0 hexbin_1.27.1 httr_1.2.0 [17] stringr_1.0.0 htmlwidgets_0.6 DistributionUtils_0.5-1 maps_3.1.0 [21] packagedocs_0.3.6 grid_3.3.0 DT_0.1.56 R6_2.1.2 [25] rmarkdown_0.9.6.14 ggplot2_2.1.0 gistr_0.3.6 magrittr_1.5 [29] whisker_0.3-2 scales_0.4.0 codetools_0.2-14 htmltools_0.3.5 [33] lazyrmd_0.1.0 assertthat_0.1 xtable_1.8-2 mime_0.4 [37] colorspace_1.2-6 httpuv_1.3.3 stringi_1.1.1 lazyeval_0.2.0 [41] munsell_0.4.3

推荐答案

尝试使用 RPostgres 包进行连接,它对我有用。查看详情此处

try to connect using RPostgres package, it worked for me. See details here

更多推荐

无法使用RPostgreSQL连接到R上的Amazon PostgreSQL RDS数据库

本文发布于:2023-10-18 12:00:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504173.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:连接到   数据库   RPostgreSQL   Amazon   RDS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!