Unable to install RMySQL on R 3.0.2 (ubuntu 14.04)

so far I have 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 

therefore I follow what he says in 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 using 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' 

therefore, looking up, I found these recommendations;

installing RMySQL gives an error RS-MySQL.h: 32: 19: fatal error: mysql.h: no such file

and following what he says here:

http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL

I do not get this step;

3. Edit or create the Renviron.site file and add the MYSQL_HOME variable, which contains the location of your MySQL installation. Typically, a file is not created when R is installed, so you may need to create it yourself. You will want to place it in the / etc directory in your home area R. If you do not know where it is, you can send R.home () to your R request. You will add a variable named MYSQL_HOME to the variable = value syntax. Here is an example: Renviron.site location: C: /PROGRA~1/R/R-2.11~1.0/etc/Renviron.site Contents: MYSQL_HOME = C: /PROGRA~1/MySQL/MYSQLS~1.0/

because when im in Renviron.site, it doesn’t let me edit anything on it, also I don’t know what I have to put there, anyway, I writte

 MYSQL_HOME=C:/PROGRA~1/MySQL/MYSQLS~1.0/*** 

but I can’t save it, it doesn’t allow me, because it says that they are not allowed, and I can’t create a new file or anything there in / etc /

+6
source share
4 answers

Your inputs are wrong, first get rid of signs more and less. Then, for the MySQL include directory, run the command:

 $ mysql_config --include 

SO, if this is the same path that you have already indicated, instead:

 export PKG_CPPFLAGS="-I</usr/include/mysql>" 

enter:

 export PKG_CPPFLAGS="-I/usr/include/mysql" 

for the library path enter the command:

 $ mysql_config --libs 

and same as above, enter the unsigned path for me:

 export PKG_LIBS="-L/usr/lib/x86_64-linux-gnu -lmysqlclient" 

Finally, at the last entry, instead of "version", indicate the version number. These steps should solve your problem. You must have permissions to edit and write to the / etc / directory, if you are an administrator, you can do this with the sudo command. as well as the path you provided for windows, not linux.

+3
source

For me, I just needed to get the correct package containing these files

 sudo apt-get install libmysqlclient-dev 
+12
source

For my version of ubuntu 14.04.3 I needed only:

install.packages("RMySQL", dependencies=TRUE)

You had a problem with Windows for a while, but it turned out to be a perl compatibility issue, so I (1) removed perl, (2) installed RMySQL in the same way (3) reinstalled perl,

It has been working ever since.

+2
source

Try the following command:

 sudo apt-get install r-cran-rmysql 
+1
source

Source: https://habr.com/ru/post/973987/


All Articles