-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
I came across a param name mismatch when I was looking at RMySQL
in particular (haven't checked the other drivers):
In DBI
, using the RMySQL
method for dbConnect
, we find the param username
:
conn <- DBI::dbConnect(
drv = RMySQL::MySQL(),
dbname = "shinydemo",
host = "shiny-demo.csa7qlmguqrf.us-east-1.rds.amazonaws.com",
username = "guest",
password = "guest"
)
# get the first 5 rows:
dbGetQuery(conn, "SELECT * from City LIMIT 5;")
#> ID Name CountryCode District Population
#> 1 1 Kabul AFG Kabol 1780000
#> 2 2 Qandahar AFG Qandahar 237500
#> 3 3 Herat AFG Herat 186800
#> 4 4 Mazar-e-Sharif AFG Balkh 127800
#> 5 5 Amsterdam NLD Noord-Holland 731200
In dplyr
, in the src_mysql
function, the same param is called user
:
my_db <- dplyr::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)
#> ID Name CountryCode District Population
#> 1 1 Kabul AFG Kabol 1780000
#> 2 2 Qandahar AFG Qandahar 237500
#> 3 3 Herat AFG Herat 186800
#> 4 4 Mazar-e-Sharif AFG Balkh 127800
#> 5 5 Amsterdam NLD Noord-Holland 731200
Metadata
Metadata
Assignees
Labels
No labels