[R] Installing RMySQL on Debian

David Winsemius dwinsemius at comcast.net
Fri Jul 11 08:50:33 CEST 2014


On Jul 10, 2014, at 1:07 PM, Federico Razzoli wrote:

>> Just to check, are you loading the package using
>> 
>> library(RMySQL)
>> 
>> before trying to use it?
>> 
>> If so, is it giving you any errors?
> 
> Hi,
> It was my first attempt, but since it didn't work I tried the other
> suggested method. By the way, here is what I get:

> What did you think when you read this:
========
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.
========
?????

I'm wondering if you understand the RMySQL is only an interface to the MySQL package, and it needs to be installed separately for your OS.

-- 
David


>> install.packages("RMySQL")
> Installing package(s) into ‘/usr/local/lib/R/site-library’
> (as ‘lib’ is unspecified)
> --- Please select a CRAN mirror for use in this session ---
> Loading Tcl/Tk interface ... done
> provo con l'URL
> 'http://cran.mirror.garr.it/mirrors/CRAN/src/contrib/RMySQL_0.9-3.tar.gz'
> Content type 'text/plain' length 165363 bytes (161 Kb)
> URL aperto
> ==================================================
> downloaded 161 Kb
> 
> * installing *source* package ‘RMySQL’ ...
> ** package ‘RMySQL’ successfully unpacked and MD5 sums checked
> checking for gcc... gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ANSI C... none needed
> checking how to run the C preprocessor... gcc -E
> checking for compress in -lz... yes
> checking for getopt_long in -lc... yes
> checking for mysql_init in -lmysqlclient... no
> checking for egrep... grep -E
> checking for ANSI C header files... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking mysql.h usability... no
> checking mysql.h presence... no
> checking for mysql.h... no
> checking for mysql_init in -lmysqlclient... no
> checking for mysql_init in -lmysqlclient... no
> checking for mysql_init in -lmysqlclient... no
> checking for mysql_init in -lmysqlclient... no
> checking for mysql_init in -lmysqlclient... no
> checking for mysql_init in -lmysqlclient... no
> checking for mysql_init in -lmysqlclient... no
> checking /usr/local/include/mysql/mysql.h usability... no
> checking /usr/local/include/mysql/mysql.h presence... no
> checking for /usr/local/include/mysql/mysql.h... no
> checking /usr/include/mysql/mysql.h usability... no
> checking /usr/include/mysql/mysql.h presence... no
> checking for /usr/include/mysql/mysql.h... no
> checking /usr/local/mysql/include/mysql/mysql.h usability... yes
> checking /usr/local/mysql/include/mysql/mysql.h presence... yes
> checking for /usr/local/mysql/include/mysql/mysql.h... yes
> 
> 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 ‘/usr/local/lib/R/site-library/RMySQL’
> * restoring previous ‘/usr/local/lib/R/site-library/RMySQL’
> 
> The downloaded source packages are in
> 	‘/tmp/RtmpaJ2WeK/downloaded_packages’
> Warning message:
> In install.packages("RMySQL") :
>  installation of package ‘RMySQL’ had non-zero exit status
> 
> 
> Federico
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list