2014-01-07 98 views
1

我試圖在使用MySQL v5.6.14時在Ubuntu 13.04中安裝RMySQL。 Ubuntu沒有對MySQL 5.6.14的apt-get支持,所以我不得不手動安裝它。現在,當我嘗試安裝RMySQL我得到如下:安裝RMySQL時出錯(在Ubuntu 13.04中爲MySQL 5.6.14)

(看起來卻沒有生成包文件,但我不知道爲什麼或如何調試呢?)。

[email protected]:~/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 

回答

1

你在本地安裝後庫運行ldconfig

是否ldconfig -p返回有關mysql的一些信息?

在我的箱子,從Ubuntu的MySQL默認庫[手動換行]

[email protected]:~$ 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 
[email protected]:~$ 
+0

這最終是一個LD_LIBRARY_PATH問題。謝謝! –