Database

Add password to root MySQL on Mac (brew)

Database with R: PostgreSQL

Load library library(tidyverse) library(RPostgres) library(DBI)

Connect to PostgreSQL Connect Method 1 with RPostgres con1 <- DBI::dbConnect(RPostgres::Postgres(), dbname = "testdb1", password = rstudioapi::askForPassword("Database password")) dbListTables(con1) #dbWriteTable(con1, "mtcars", mtcars) #dbWriteTable(con1, "flights", nycflights13::flights) rstudioapi::askForPassword requires the password input

In the command line (or block-run), there will be popout dialog to input password,

In the knit mode, render the RMarkdown file as follows: rmarkdown::render("MyDocument.Rmd", params = "ask") See Parameter User Interfaces In the blogdown, server_site will halt at the above block.