cas_set_db | R Documentation |
Set database connection settings for the session
cas_set_db(
db_settings = NULL,
driver = NULL,
host = NULL,
port,
database,
user,
pwd
)
db_settings |
A list of database connection settings (see example) |
driver |
A database driver. Common database drivers include |
host |
Host address, e.g. "localhost". |
port |
Port to use to connect to the database. |
database |
Database name. |
user |
Database user name. |
pwd |
Password for the database user. |
A list with all given parameters (invisibly).
Other database functions:
cas_check_db_folder()
,
cas_check_use_db()
,
cas_connect_to_db()
,
cas_create_db_folder()
,
cas_disable_db()
,
cas_disconnect_from_db()
,
cas_enable_db()
,
cas_get_db_settings()
,
cas_read_from_db()
,
cas_set_db_folder()
,
cas_write_to_db()
if (interactive()) {
# Settings can be provided either as a list
db_settings <- list(
driver = "MySQL",
host = "localhost",
port = 3306,
database = "castarter",
user = "secret_username",
pwd = "secret_password"
)
cas_set_db(db_settings)
# or as parameters
cas_set_db(
driver = "MySQL",
host = "localhost",
port = 3306,
database = "castarter",
user = "secret_username",
pwd = "secret_password"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.