# \donttest{
if (interactive()) {
# Settings can be provided either as a list
db_settings <- list(
driver = "MySQL",
host = "localhost",
server = "localhost",
port = 3306,
database = "tidywikidatar",
user = "secret_username",
pwd = "secret_password"
)
tw_set_cache_db(db_settings)
# or as parameters
tw_set_cache_db(
driver = "MySQL",
host = "localhost",
server = "localhost",
port = 3306,
database = "tidywikidatar",
user = "secret_username",
pwd = "secret_password"
)
# or ignoring fields that can be left to default values, such as "localhost" and port 3306
tw_set_cache_db(
driver = "MySQL",
database = "tidywikidatar",
user = "secret_username",
pwd = "secret_password"
)
}
# }
Run the code above in your browser using DataLab