I'm trying to install RMySQL in Ubuntu 13.04 when using MySQL v5.6.14. Ubuntu does not have apt-get support for MySQL 5.6.14, so I had to install it manually. Now when I try to install RMySQL I get the following:
我正在尝试使用MySQL v5.6.14在Ubuntu 13.04中安装RMySQL。 Ubuntu没有apt-get支持MySQL 5.6.14,所以我不得不手动安装它。现在,当我尝试安装RMySQL时,我得到以下内容:
(It looks like the package files are not created? But I'm not sure why or how to debug it.)
(看起来包文件没有创建?但我不确定为什么或如何调试它。)
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’
Update:
更新:
This ended up being a LD_LIBRARY_PATH issue. Adding the following to /usr/bin/R solved it:
这最终成为LD_LIBRARY_PATH问题。将以下内容添加到/ usr / bin / R解决了它:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH/opt/mysql/server-5.6/lib
export LD_LIBRARY_PATH
1 个解决方案
#1
1
Did you run ldconfig
after installing the library locally?
在本地安装库后是否运行了ldconfig?
Does ldconfig -p
return something regarding mysql?
ldconfig -p是否会返回有关mysql的内容?
On my box, with default MySQL libraries from Ubuntu [lines wrapped by hand]
在我的盒子上,使用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:~$
#1
1
Did you run ldconfig
after installing the library locally?
在本地安装库后是否运行了ldconfig?
Does ldconfig -p
return something regarding mysql?
ldconfig -p是否会返回有关mysql的内容?
On my box, with default MySQL libraries from Ubuntu [lines wrapped by hand]
在我的盒子上,使用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:~$