2016年9月16日金曜日

MySQL-R connection

This is the memo, which might be replaced by more comprehensive ones.

Install R package.


DBI  
RMySQL 

Homebrew package for OS

mariadb-connector-c

After installing mariadb-connector-c, it might not be able to install homebrew mysql package. The process ends abnormally with the message to unlink mariadb-connector-c.

samples codes.

con <- dbConnect(MySQL(), host="10.251.66.58", port=3306, dbname="DB_NAME", user="USER_ID", password="PASSWORD")
supportdataset <- dbGetQuery(con,"SELECT * FROM csupportdata")

replace DB_NAME,USER_ID and PASSWORD with appropriate ones.

0 件のコメント: