Keep in mind this page (http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL)
Install MySQL Community Server from (http://dev.mysql.com/downloads/mysql/)
Then (from StackOverflow)
-
Go to
System->Advanced->Enviroment Variables
, pressNew
and Enter Variable name asMYSQL_HOME
and Variable values asC:/PROGRA~1/MYSQL/MYSQLS~1.6
, and notice that it is/
not\
. This is a bit different from the StackOverflow answer - the trick is to use the Windows shortname. Open a command window, go to your MySQL directory, and typedir /x
to get the correct particular ending. From R, confirm by typingSys.getenv("MYSQL_HOME")
. -
Copy
C:/Program Files/MySQL/MySQL Server 5.6/lib/libmysql.dll
toC:/Program Files/MySQL/MySQL Server 5.6/bin
-
Create
C:/Program Files/MySQL/MySQL Server 5.6/lib/opt
folder andcopy C:/Program Files/MySQL/MySQL Server 5.6/lib/libmysql.lib
to theopt
folder
In R, run install.packages('RMySQL',type='source')
Get RMySQL_0.9-3.tar.gz
from CRAN
Get mysql-5.7.4-m14-osx10.7-x86_64.dmg
from http://dev.mysql.com/downloads/mysql/5.7.html
Load and install the mysql package
link the library to the R framework library this is the trick, from the Mac terminal:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /Library/Frameworks/R.framework/Resources/lib
from the directory containing your CRAN download, from the Mac terminal:
R CMD INSTALL --configure-args='--with-mysql-inc=/usr/local/mysql/include --with-mysql-lib=/usr/local/mysql/lib' RMySQL_0.9-3.tar.gz