ZombieSniper
C:\Program Files\R\R-2.15.3\bin>R CMD INSTALL "E:\Statistics\RMySQL_0.8-0.tar.gz
"
* installing to library 'C:/Program Files/R/R-2.15.3/library'
* installing *source* package 'RMySQL' ...
checking for $MYSQL_HOME... C:Program FilesMySQLMySQL Server 5.0
test: FilesMySQLMySQL: unknown operand
cygwin warning:
MS-DOS style path detected: C:/PROGRA~1/R/R-215~1.3/bin/i386/Rscript
Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-215~1.3/bin/i386/Rscri
pt
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
** libs
警告: this package has a non-empty 'configure.win' file,
so building only the main architecture
cygwin warning:
MS-DOS style path detected: C:/PROGRA~1/R/R-215~1.3/etc/i386/Makeconf
Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-215~1.3/etc/i386/Makec
onf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
gcc -m32 -I"C:/PROGRA~1/R/R-215~1.3/include" -DNDEBUG -I"C:Program FilesMySQLMyS
QL Server 5.0"/include -I"d:/RCompile/CRANpkg/extralibs64/local/include"
-O3 -Wall -std=gnu99 -mtune=core2 -c RS-DBI.c -o RS-DBI.o
RS-DBI.c: In function 'RS_na_set':
RS-DBI.c:1219:11: warning: variable 'c' set but not used [-Wunused-but-set-varia
ble]
gcc -m32 -I"C:/PROGRA~1/R/R-215~1.3/include" -DNDEBUG -I"C:Program FilesMySQLMyS
QL Server 5.0"/include -I"d:/RCompile/CRANpkg/extralibs64/local/include"
-O3 -Wall -std=gnu99 -mtune=core2 -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 such file or directory
compilation terminated.
make: *** [RS-MySQL.o] Error 1
ERROR: compilation failed for package 'RMySQL'
* removing 'C:/Program Files/R/R-2.15.3/library/RMySQL'
lyxmoo
cygwin 里你需要安装一个 mysql-dev 什么的包;
如果实在不行,cygwin里装一个 mysql-client 的包。
再不行,cygwin里自己编译一个 mysqldb 。
以上三条都很麻烦,干脆换个linux的环境。
ZombieSniper
[未知用户]
这么麻烦?对于我一个非计算机专业的,搞不定啊。。
我安装RMysql的方法都是按照网上大神的步骤,一步步来的。而且文件夹里也有mysql.h的文件啊。不知道是哪个路径除了问题。。 :?:
langrenwanghu
直接搞个vmware虚拟机得了
lyxmoo
[未知用户]
你的问题不是RMysql的问题,是cygwin环境里的问题。
计算机专业也一没有贴标签二课堂里也不教操作,先破除自己的心障;
ZombieSniper
[未知用户]
谢谢版主的教诲!
我破除了自己的心障,在网上又找到一篇贴子,解决了安装的问题。可是又出了新的问题。。。
原文出处:http://edu.dataguru.cn/home.php?mod=space&uid=54954&do=blog&id=1814
按照那位大神的方法的第4步,就解决了安装的问题。
从文件名字推断'repos = NULL'
* installing *source* package 'RMySQL' ...
checking for $MYSQL_HOME... C:/Program Files/MySQL/MySQL Server 5.0
cygwin warning:
MS-DOS style path detected: C:/Program
Preferred POSIX equivalent is: /cygdrive/c/Program
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
test: Files/MySQL/MySQL: unknown operand
** libs
警告: this package has a non-empty 'configure.win' file,
so building only the main architecture
cygwin warning:
MS-DOS style path detected: C:/PROGRA~1/R/R-215~1.3/etc/i386/Makeconf
Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-215~1.3/etc/i386/Makeconf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
gcc -m32 -I"C:/PROGRA~1/R/R-215~1.3/include" -DNDEBUG -I"C:/Program Files/MySQL/MySQL Server 5.0"/include -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O3 -Wall -std=gnu99 -mtune=core2 -c RS-DBI.c -o RS-DBI.o
RS-DBI.c: In function 'RS_na_set':
RS-DBI.c:1219:11: warning: variable 'c' set but not used [-Wunused-but-set-variable]
gcc -m32 -I"C:/PROGRA~1/R/R-215~1.3/include" -DNDEBUG -I"C:/Program Files/MySQL/MySQL Server 5.0"/include -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O3 -Wall -std=gnu99 -mtune=core2 -c RS-MySQL.c -o RS-MySQL.o
RS-MySQL.c: In function 'RS_MySQL_fetch':
RS-MySQL.c:657:13: warning: variable 'fld_nullOk' set but not used [-Wunused-but-set-variable]
RS-MySQL.c: In function 'RS_DBI_invokeBeginGroup':
RS-MySQL.c:1133:30: warning: variable 'val' set but not used [-Wunused-but-set-variable]
RS-MySQL.c: In function 'RS_DBI_invokeNewRecord':
RS-MySQL.c:1154:20: warning: variable 'val' set but not used [-Wunused-but-set-variable]
RS-MySQL.c: In function 'RS_MySQL_dbApply':
RS-MySQL.c:1215:38: warning: variable 'fld_nullOk' set but not used [-Wunused-but-set-variable]
gcc -m32 -shared -s -static-libgcc -o RMySQL.dll tmp.def RS-DBI.o RS-MySQL.o C:/Program Files/MySQL/MySQL Server 5.0/lib/opt/libmysql.lib -Ld:/RCompile/CRANpkg/extralibs64/local/lib/i386 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-215~1.3/bin/i386 -lR
安装至 C:/Program Files/R/R-2.15.3/library/RMySQL/libs/i386
** 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
* DONE (RMySQL)
> library(RMySQL)
载入需要的程辑包:DBI
Error : .onLoad failed in loadNamespace() for 'RMySQL', details:
call: NULL
error: MYSQL_HOME was set but does not point to a directory
错误: ‘RMySQL’程辑包/名字空间载入失败,
为什么MYSQL_HOME was set but does not point to a directory
怎么就不point to a directory了呢? :?:
ZombieSniper
可以了。我修改MYSQL_HOME时,没有重新运行R。
谢谢大家! ;-)