@josh thanks for your reply. Here is my connection call, which I define on top of my Server.R script.
library(DBI)
library(RMySQL)
library(pool)
pool <- dbPool(
drv = RMySQL::MySQL(),
dbname = "db_name",
host = "XXX.XXX.XXX.XXX",
username = 'user_name',
password = 'password'
)
onStop(function() {
poolClose(pool)
})