Linux中的RMySQL安装生成错误

时间:2015-11-18 01:44:08

标签: r linux

我正在尝试通过R studio在Ubuntu中安装RMySQL,但我遇到了以下错误。有人可以帮我解决这个问题。

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’

1 个答案:

答案 0 :(得分:22)

只做

 sudo apt-get install r-cran-rmysql

正如我们所拥有的那样an Ubuntu package RMySQL(你们真正是underlying Debian package的维护者)。

我们将这些作为二进制文件保留是有原因的:所以你不要自杀,试图想要手工完成。