有时,我需要针对查询数据库时遇到的错误制作可重现的示例;有时这些错误无法使用内置数据集重现。
是否有任何可用于制作可重复示例的公开可用数据库列表?
我知道他的
src_mysql(dbname = "dplyr",
host = "dplyr.csrrinzqubik.us-east-1.rds.amazonaws.com",
port = 3306,
user = "dplyr",
password = "dplyr")
但它给了我一个错误
Error in .local(drv, ...) :
Failed to connect to database: Error: Unknown MySQL Server Host 'dplyr.csrrinzqubik.us-east-1.rds.amazonaws.com' (8)
我在臭名昭著的问题 How to make a great R reproducible example? 中没有找到对这种特定情况的任何引用。
最佳答案
来自 http://shiny.rstudio.com/articles/
library(dplyr)
my_db <- src_mysql(
dbname = "shinydemo",
host = "shiny-demo.csa7qlmguqrf.us-east-1.rds.amazonaws.com",
user = "guest",
password = "guest"
)
# get the first 5 rows:
my_db %>% tbl("City") %>% head(5)
关于r - 如何制作可重现的数据库连接示例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38752643/