无法在R 3.0.2上安装RMySQL(ubuntu 14.04)

到目前为止,我有这个错误;
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

所以我按照1所说的说法.

我输入

export PKG_CPPFLAGS="-I</usr/include/MysqL>"
export PKG_LIBS="-L</usr/lib/MysqL> -lMysqLclient"

然后再次尝试在终端上安装他们给我的命令

R CMD INSTALL RMysqL_<version>.tar.gz

而我得到;

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

所以抬头我发现了这个建议;

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

并遵循它在这里所说的:

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

我没有这一步;

3.编辑或创建文件Renviron.site并添加包含MysqL安装位置的变量MysqL_HOME.安装R时通常不会创建该文件,因此您可能需要自己创建.您需要将它放在R Home区域的/ etc目录下.如果您不知道它在哪里,可以在R提示符下发出R.home().您将在variable = value语法中添加名为MysqL_HOME的变量.这是一个例子:
Renviron.site的位置:C:/PROGRA~1/R/R-2.11〜1.0/etc/Renviron.site
内容是:
MysqL_HOME = C:/PROGRA~1/MysqL/MysqLS~1.0/

因为,当我在Renviron.site中,它不会让我编辑任何东西,我也不清楚我应该放在那里,无论如何,我写

MysqL_HOME=C:/PROGRA~1/MysqL/MysqLS~1.0/***

但我不能保存它,它不会让我,因为它说我不允许,我不能在/ etc /中创建一个文件或任何东西

你的输入是错误的,首先要摆脱大于和小于标志.然后为MysqL include目录运行命令:
$MysqL_config --include

如果它与您已经提供的路径相同而不是:

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

输入:

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

对于库路径输入命令:

$MysqL_config --libs

和上面一样进入路径没有我的标志就像是:

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

最后在最后一个输入而不是“版本”中指定版本号.这些步骤可以解决您的问题.要在/ etc /目录中进行编辑和编写,您应具有权限,如果您是管理员,则可以通过sudo命令执行此操作.而且你提供的路径是windows而不是linux.

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...