commit af71948632980a38d306d7bb85dbf8be4fa352c9 Author: = Date: Fri Sep 2 17:06:02 2022 -0400 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b0afbf6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.code-workspace +config.R diff --git a/alai.R b/alai.R new file mode 100644 index 0000000..2de5694 --- /dev/null +++ b/alai.R @@ -0,0 +1,5 @@ +source("config.R") + +if (!exists("dbListTables", mode = "function")) source("mysql.R") + +dbListTables(conn) diff --git a/config.R.example b/config.R.example new file mode 100644 index 0000000..df77224 --- /dev/null +++ b/config.R.example @@ -0,0 +1,5 @@ +dbuser <- 'user' +dbpass <- 'pass' +dbname <- 'dbname' +dbhost <- 'localhost' +dbport <- 3306 diff --git a/install_libs.R b/install_libs.R new file mode 100644 index 0000000..6a8d48d --- /dev/null +++ b/install_libs.R @@ -0,0 +1 @@ +install.packages("RMySQL") diff --git a/mysql.R b/mysql.R new file mode 100644 index 0000000..bd7e142 --- /dev/null +++ b/mysql.R @@ -0,0 +1,10 @@ +library(RMySQL) + +conn = dbConnect( + MySQL(), + user = dbuser, + password = dbpass, + dbname = dbname, + host = dbhost, + port = dbport +)