mysqlHasDefault: Check if default database is available.

View source: R/default.R

mysqlHasDefaultR Documentation

Check if default database is available.

Description

RMySQL examples and tests connect to a database defined by the rs-dbi group in ~/.my.cnf. This function checks if that database is available, and if not, displays an informative message.

Usage

mysqlHasDefault()

Examples

if (mysqlHasDefault()) {
  db <- dbConnect(RMySQL::MySQL(), dbname = "test")
  dbListTables(db)
  dbDisconnect(db)
}

RMySQL documentation built on Sept. 26, 2023, 5:11 p.m.