I am having trouble installing RMySQL. I am trying to install it from its source in the following way:
install.packages(\"/path/to/package/RMySQL_0.9-3.tar.g
I followed the above instructions:
brew install mysql
Then in RStudio:
Sys.setenv(PKG_CPPFLAGS = "-I/usr/local/include/mysql")
Sys.setenv(PKG_LIBS = "-L/usr/local/lib -lmysqlclient")
install.packages("RMySQL", type="source")
It gives the error:
In file included from RS-MySQL.c:22:
./RS-MySQL.h:32:10: fatal error: 'mysql.h' file not found
#include
^ 1 error generated.
make: *** [RS-MySQL.o] Error 1
ERROR: compilation failed for package ‘RMySQL’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RMySQL’
To solve it, change the last command in RStudio to:
install.packages("RMySQL",
configure.args="--with-mysql-dir=/usr/local/bin/
--with-mysql-inc=/usr/local/include/mysql
--with-mysql-lib=/usr/local/lib", type="source")
Hope this helps.