Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RMySQL installation generating error in linux [closed]

Tags:

linux

r

I am trying to install RMySQL in Ubuntu through R studio, but I am running into this error below. Can someone help me resolve this please.

Installing package into ‘/R_latest/lib/R/library’
(as ‘lib’ is unspecified)
--2015-11-18 11:40:26--  https://cran.rstudio.com/src/contrib/RMySQL_0.10.7.tar.gz
Resolving cran.rstudio.com (cran.rstudio.com)... 54.230.132.47
Connecting to cran.rstudio.com (cran.rstudio.com)|54.230.132.47|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 52422 (51K) [application/x-gzip]
Saving to: '/tmp/Rtmp52166B/downloaded_packages/RMySQL_0.10.7.tar.gz’

     0K .......... .......... .......... .......... .......... 97% 1.73M 0s
    50K .                                                     100% 2276G=0.03s

2015-11-18 11:40:26 (1.77 MB/s) - '/tmp/Rtmp52166B/downloaded_packages/RMySQL_0.10.7.tar.gz’ saved [52422/52422]

* installing *source* package ‘RMySQL’ ...
** package ‘RMySQL’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=
Using PKG_LIBS=-lmysqlclient -lz
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libmysqlclient was not found. Try installing:
 * deb: libmysqlclient-dev | libmariadb-client-lgpl-dev (Debian)
        libmysqlclient-dev | libmariadbclient-dev (Ubuntu)
 * rpm: mariadb-devel | mysql-devel (Fedora, CentOS, RHEL)
 * csw: mysql56_dev (Solaris)
 * brew: mysql-connector-c (OSX)
If libmysqlclient is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libmysqlclient.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
    install.packages('RMySQL',type='source')     
    ERROR: configuration failed for package ‘RMySQL’
        * removing ‘/R_latest/lib/R/library/RMySQL’
        Warning in install.packages :
          installation of package ‘RMySQL’ had non-zero exit status

        The downloaded source packages are in
            ‘/tmp/Rtmp52166B/downloaded_packages’
like image 537
MAPK Avatar asked Nov 18 '15 01:11

MAPK


1 Answers

Just do

 sudo apt-get install r-cran-rmysql

as we do have an Ubuntu package RMySQL (and yours truly is the maintainer for the underlying Debian package).

We maintain those as binaries for a reason: so that you don't kill yourself trying to figure out to do it by hand.

like image 91
Dirk Eddelbuettel Avatar answered Nov 19 '22 20:11

Dirk Eddelbuettel