1

我已经在 CENTOS 6.5 上成功安装了 InifiniDB。InfiniDB 是与 MySQL“兼容”的柱状数据库(相同的端口等:我什至设法安装了最新版本的 MySQLWorkbench,并且与 InifiniDB 一起工作很有魅力 - 相信只需处理另一个安装的 MySQL)。

安装没有 MySQL,因为我不需要它:)

我尝试从 RStudio Server 安装 RMySQL,但无法安装:安装程序希望在某处找到 MySQL 的副本,但我没有。

请参阅下面的安装日志。我将 :/usr/local/Calpont/mysql/bin 放在我的 PATH 中,但这没有任何效果。

请考虑到这个灵感来自 InfiniDB 本身:见这里http://infinidb.co/system/files/Calpont%20InfiniDB_Quick%20Start_for%20R.pdf 我猜主要问题,比较错误和 InfiniDB 论文,是他们建议创建以下全局变量:

(From InfiniDB paper) RMySQL must be configured with the correct MySQL directory 
(which comes with InfiniDB) and the developer library directory. 
o Example in Ubuntu or CentOS: 
export MYSQL_INC=”/usr/include/mysql/”
export MYSQL_LIB=”/usr/local/Calpont/mysql/lib/mysql”

但是我在 CENTOS 上的安装在 /usr/include/mysql/ 没有 mysql 文件夹。

有什么建议么?

===============

Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/RMySQL_0.9-3.tar.gz'
Content type 'application/x-gzip' length 165363 bytes (161 Kb)
opened URL
==================================================
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... no
checking /usr/local/mysql/include/mysql/mysql.h presence... no
checking for /usr/local/mysql/include/mysql/mysql.h... no
checking /opt/include/mysql/mysql.h usability... no
checking /opt/include/mysql/mysql.h presence... no
checking for /opt/include/mysql/mysql.h... no
checking /include/mysql/mysql.h usability... no
checking /include/mysql/mysql.h presence... no
checking for /include/mysql/mysql.h... no

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/lib64/R/library/RMySQL’
Warning in install.packages :
  installation of package ‘RMySQL’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmpz2Q4Wl/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
4

2 回答 2

5

您确实需要安装 mysql-devel。请参阅 InfiniDB 网站上 R 快速入门指南的第 3 步。它声明如下:

在客户端机器上安装 MySQL 开发人员库。可从http://www.mysql.comhttp://dev.mysql.com 获得,或者您可以使用像 apt-get 这样的包安装程序。如果您已经安装了 MySQL 服务器,请确保客户端头文件和库文件包含在安装中。

Ubuntu 中的示例:

sudo apt-get install mysql-client libmysqlclient-dev 

CentOS 中的示例

sudo yum install mysql mysql-devel

如果您还有其他问题,请随时在 InfiniDB 论坛中发帖。

于 2014-02-24T16:25:59.873 回答
1

我找到了一个解决方案。

首先,我的前提是能够在不添加 MySQL 安装的情况下将 RMySQL 与 InfiniDB 一起使用。

(根据维基百科)“通过 MySQL 接口访问 InfiniDB”。最近一篇关于 R 和 InifiniDB 的 InfiniDB 网站上的论文(“R 统计计算快速入门指南”)列出了在 R 中使用 RMySQL 安装和使用 InfiniDB 的简单说明,没有提及任何先决条件。

我发现这是不正确的。在我的 CENTOS 安装中,我无法编译 RMySQL 包。缺少的 mysql.h 阻止了它。

我找到的解决方案是用 yum 安装 mysql-devel。Yum 还安装了 mysql 客户端程序和共享库作为依赖项。

另一方面,使用 yum 的总安装量为 3MB,我仍然可以说我不需要安装 MySQL 服务器(至少!),因为 RMySQL+InfiniDB 只需要 MySQL 库即可工作。

于 2014-02-23T10:29:45.310 回答