Reputation: 629
so far i had this error;
Configuration error:
could not find the MySQL installation include and/or library
directories. Manually specify the location of the MySQL
libraries and the header files and re-run R CMD INSTALL.
INSTRUCTIONS:
1. Define and export the 2 shell variables PKG_CPPFLAGS and
PKG_LIBS to include the directory for header files (*.h)
and libraries, for example (using Bourne shell syntax):
export PKG_CPPFLAGS="-I<MySQL-include-dir>"
export PKG_LIBS="-L<MySQL-lib-dir> -lmysqlclient"
Re-run the R INSTALL command:
R CMD INSTALL RMySQL_<version>.tar.gz
2. Alternatively, you may pass the configure arguments
--with-mysql-dir=<base-dir> (distribution directory)
or
--with-mysql-inc=<base-inc> (where MySQL header files reside)
--with-mysql-lib=<base-lib> (where MySQL libraries reside)
in the call to R INSTALL --configure-args='...'
R CMD INSTALL --configure-args='--with-mysql-dir=DIR' RMySQL_<version>.tar.gz
ERROR: configuration failed for package ‘RMySQL’
* removing ‘/home/samuel/R/x86_64-pc-linux-gnu-library/3.0/RMySQL’
Warning in install.packages :
installation of package ‘./RMySQL_0.9-3.tar.gz’ had non-zero exit status
so i follow what it says at 1.
i input
export PKG_CPPFLAGS="-I</usr/include/mysql>"
export PKG_LIBS="-L</usr/lib/mysql> -lmysqlclient"
and then try again on the terminal to install with the command they give me
R CMD INSTALL RMySQL_<version>.tar.gz
and i get;
checking for unistd.h... yes
checking mysql.h usability... no
checking mysql.h presence... no
checking for mysql.h... no
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I</usr/include/mysql> -fpic -O3 -pipe -g -c RS-DBI.c -o RS-DBI.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I</usr/include/mysql> -fpic -O3 -pipe -g -c RS-MySQL.c -o RS-MySQL.o
In file included from RS-MySQL.c:22:0:
RS-MySQL.h:32:19: fatal error: mysql.h: No existe el archivo o el directorio
#include <mysql.h>
^
compilation terminated.
make: *** [RS-MySQL.o] Error 1
ERROR: compilation failed for package ‘RMySQL’
so looking up i found this recommendations;
installing RMySQL gives error RS-MySQL.h:32:19: fatal error: mysql.h: No such file
and following what it says here:
http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL
i don't get this step;
3. Edit or create the file Renviron.site and add the variable MYSQL_HOME which contains the location of your MySQL install. The file typically isn't created when installing R, so you may need to create it yourself. You will want to place it under the /etc directory in your R Home area. If you don't know where that is, you can issue R.home() at your R prompt. You will be adding a variable named MYSQL_HOME in variable=value syntax. Here's an example: Location of Renviron.site: C:/PROGRA~1/R/R-2.11~1.0/etc/Renviron.site Content is: MYSQL_HOME=C:/PROGRA~1/MySQL/MYSQLS~1.0/
because, when im in the Renviron.site, it doesn't let me edit on it anything, also i dont have clear what i should put there, anyway, i writte
MYSQL_HOME=C:/PROGRA~1/MySQL/MYSQLS~1.0/***
but i cant save it, it doesnt let me, because it says im not allowed, and i can't create a new file or anything there in /etc/
Upvotes: 9
Views: 9300
Reputation: 13
Setp :1 Try to find mysql.h file from machine
find / -name mysql.h
if you could not find Setp :2 Try to re install
sudo yum reinstall mysql-devel
Sudo yum reinstall mysql-client
If its community server
sudo yum reinstall mysql-community-devel
Sudo yum reinstall mysql-community-client
Upvotes: 0
Reputation: 166
When I tried installing RMySQL in R, it prompted an error saying:
Configuration failed because no mysql client library was found. Try installing:
* deb: libmariadbclient-dev | libmariadb-client-lgpl-dev (Debian, Ubuntu)
Then I just did:
sudo apt-get install libmariadbclient-dev
sudo apt-get install libmariadb-client-lgpl-dev
And I was able to install RMySQL in R using:
install.packages("RMySQL", dependencies=TRUE)
Upvotes: 2
Reputation: 1043
For my ubuntu version 14.04.3 all I needed to do was:
install.packages("RMySQL", dependencies=TRUE)
Had more of a problem on a windows machine a while back but, it turned out it was a compatibility issue with perl so I (1) uninstalled perl, (2) installed RMySQL in a same way then (3) reinstalled perl.
Has worked ever since.
Upvotes: 4
Reputation: 15659
For me I just needed to get the right package containing these files
sudo apt-get install libmysqlclient-dev
Upvotes: 17
Reputation: 56
Your inputs are wrong, first of all get rid of the greater than and less than signs. Then for the MySQL include directory run the command:
$ mysql_config --include
SO if it's the same path that you already provided instead of:
export PKG_CPPFLAGS="-I</usr/include/mysql>"
enter:
export PKG_CPPFLAGS="-I/usr/include/mysql"
for library path enter the command:
$ mysql_config --libs
and same with the above enter the path without the signs for me it is like:
export PKG_LIBS="-L/usr/lib/x86_64-linux-gnu -lmysqlclient"
Finally in the last input instead of "version" specify a version number. These steps should fix your problem. For editing and writing in the /etc/ directory you should have the permissions, if you are the administrator you can do that by sudo command. and also the path that you provided is for windows not linux.
Upvotes: 3