Learn R Programming

compendiumdb (version 1.0.3)

connectDatabase: Create connection with the MySQL compendium database

Description

Allows the user to create a connection with the compendium database in the MySQL server

Usage

connectDatabase(user, password, host = "localhost", dbname = "compendium", port = 3306)

Arguments

user
character string defining the MySQL user name to login to the database
password
character string defining the password required to connect to the MySQL database
host
character string defining the host name. The default value is "localhost". One can also connect to a remote server by defining a valid value for the host name, e.g., "machinename.\domain.\org".
dbname
character string defining the name of the compendium database to which one wants to establish a connection. The default value is "compendium".
port
port number used to connect to the MySQL server. The default port number is 3306.

Value

A list with components
connect
a component of class MySQLConnection containing the connection to the MySQL database
user
character string containing the user name
password
character string containing the password
host
character string containing the host name
port
port number used to connect to the MySQL server
dbname
character string containing the database name

Details

The compendium database has to be created first, see the package vignette for how to do this from the MySQL prompt.

Examples

Run this code
 ## Not run: 
#   # Connect to a database with name "compendium"
#   conn <- connectDatabase(user="usrname",password="passwd",host="localhost",dbname="compendium")
#  ## End(Not run)

Run the code above in your browser using DataLab