r - 安装 RMySQL 时出错(Ubuntu 13.04 中的 MySQL 5.6.14)

标签 r ubuntu rmysql

使用 MySQL v5.6.14 时,我正在尝试在 Ubuntu 13.04 中安装 RMySQL。 Ubuntu 没有对 MySQL 5.6.14 的 apt-get 支持,所以我不得不手动安装它。现在,当我尝试安装 RMySQL 时,我得到以下信息:

(看起来包文件没有创建?但我不确定为什么或如何调试它。)

elad@elad-ThinkPad-T430s:~/tmp$ sudo R CMD INSTALL --configure-args='--with-mysql-inc=/opt/mysql/server-5.6/include --with-mysql-lib=/opt/mysql/server-5.6/lib' RMySQL_0.9-3.tar.gz 
* installing to library ‘/usr/local/lib/R/site-library’
* 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
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/opt/mysql/server-5.6/include     -fpic  -O2 -pipe -g  -c RS-DBI.c -o RS-DBI.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/opt/mysql/server-5.6/include     -fpic  -O2 -pipe -g  -c RS-MySQL.c -o RS-MySQL.o
gcc -std=gnu99 -shared -o RMySQL.so RS-DBI.o RS-MySQL.o -L/opt/mysql/server-5.6/lib -lmysqlclient -lz -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/RMySQL/libs
** R
** inst
** preparing package for lazy loading
Creating a generic function for ‘format’ from package ‘base’ in package ‘RMySQL’
Creating a generic function for ‘print’ from package ‘base’ in package ‘RMySQL’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error : .onLoad failed in loadNamespace() for 'RMySQL', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/usr/local/lib/R/site-library/RMySQL/libs/RMySQL.so':
  libmysqlclient.so.18: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/RMySQL’
* restoring previous ‘/usr/local/lib/R/site-library/RMySQL’

更新:

这最终成为 LD_LIBRARY_PATH 问题。将以下内容添加到/usr/bin/R 解决了它:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH/opt/mysql/server-5.6/lib
export LD_LIBRARY_PATH

最佳答案

你跑了吗ldconfig在本地安装库后?

是否 ldconfig -p返回有关 mysql 的内容?

在我的盒子上,带有来自 Ubuntu 的默认 MySQL 库 [手工包装的行]

edd@max:~$ ldconfig -p | grep mysql
        libmysqlclient.so.18 (libc6,x86-64) => \
               /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18
        libmysqlclient.so (libc6,x86-64) => \
               /usr/lib/x86_64-linux-gnu/libmysqlclient.so
edd@max:~$ 

关于r - 安装 RMySQL 时出错(Ubuntu 13.04 中的 MySQL 5.6.14),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20975207/

相关文章:

mysql - R中的序列化对象到mysql数据库

mysql - 在 R 中使用 RMySQL 和 .my.cnf 文件连接到数据库

r - 如何从 Shiny 的文本输入更新字符向量?

r - 将 json 列解压到数据框中

r - 选择匹配列单元格序列下方的 n 个单元格

r - 如何通过R中的第二个分组变量分配 "reseting"组号?

java - 试过 tjavax.mail.MessagingException : Unknown SMTP host: "smtp.office365.com";

c - 为什么即使添加未初始化的全局变量,size 命令显示的 bss 值也不会增加?

python - 在没有 root 的情况下安装 z3 后的路径问题

mysql - 从 rmysql 修改列名而不更改表中的值