Hi all,

I'm trying to install the RMySQL package; I'm working on a Windows 64-bit
machine with version 3.1.0 installed in R. I've tried two different methods
of installing this software: through RStudio and through good old Command
Prompt. Additionally, I have Cygwin installed and have gotten this
installation to work through Cygwin, but am still trying to install this
package under my Windows installation of R so that I can use RStudio. Also,
I have installed the most recent of Rtools, but did not include the Cygwin
DLLs (as I have Cygwin installed).

I first tried installing RMySQL through RStudio. I have the "MYSQL_HOME"
variable correctly set in my Renviron.site file. I then tried entering
"install.packages("RMySQL", type = "source")" on the RStudio prompt. The
following is output from that command:

> install.packages("RMySQL", type = "source")Installing package into ‘C:/Users/Ashutosh/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)trying URL
'http://cran.rstudio.com/src/contrib/RMySQL_0.9-3.tar.gz'Content type
'application/x-gzip' length 165363 bytes (161 Kb)opened URLdownloaded
161 Kb
--- Output coming from .Rprofile in "~" directory ---
Welcome at Wed Jul 23 23:35:18 2014
Set "JAVA_HOME" environment variable to empty (for rJava purposes)

Firstly, don't call your matrix 'matrix'. Would you call your dog 'dog'?
Anyway, it might clash with the function 'matrix'.
   -- Barry Rowlingson
      R-help (October 2004)

* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
checking for $MYSQL_HOME... C:/MySQL_5.6
test: Output: unknown operand
Warning: running command 'sh ./configure.win' had status 127
ERROR: configuration failed for package 'RMySQL'
* removing 'C:/Users/Ashutosh/Documents/R/win-library/3.1/RMySQL'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-31~1.0/bin/x64/R" CMD INSTALL -l
"C:\Users\Ashutosh\Documents\R\win-library\3.1"
C:\Users\Ashutosh\AppData\Local\Temp\Rtmp0CV6RO/downloaded_packages/RMySQL_0.9-3.tar.gz'
had status 1
Warning in install.packages :
  installation of package ‘RMySQL’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\Ashutosh\AppData\Local\Temp\Rtmp0CV6RO\downloaded_packages’


Something seems to be up with the configure.win file but I cannot modify it
as the MD5 sums won't check out. If there is something I can do so that the
test command actually works, please let me know, and maybe this
installation option will work!!


I then tried running that exact command in Command Prompt (in Administrator
mode) to see if I could get more information. To my surprise, it seemed to
install the entire package successfully. Here is output corresponding to
the command:

C:\Users\Ashutosh\Documents\R Packages (Manually Installed)>"C:\Program
Files\R\
R-3.1.0\bin\x64\R" CMD INSTALL RMySQL_0.9-3.tar.gz
--- Output coming from .Rprofile in "~" directory ---
Welcome at Wed Jul 23 23:57:32 2014
Set "JAVA_HOME" environment variable to empty (for rJava purposes)

Uwe Ligges: Please stop sending unsensible bug reports! Those have to be
handled manually in the bug repository!
Barry Rowlingson: Really? They seem to be being handled automatically and
frighteningly well by the Uwe-bot at the moment. Congratulations, you've
passed
the Turing Test.
   -- Uwe Ligges and Barry Rowlingson (after several nonsensical mails to
      R-bugs)
      R-devel (July 2004)

* installing to library 'C:/Users/Ashutosh/Documents/R/win-library/3.1'
* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
checking for $MYSQL_HOME... C:/MySQL_5.6
./configure.win: line 16: test: too many arguments
** libs
Warning: this package has a non-empty 'configure.win' file,
so building only the main architecture

gcc -m64 -I"C:/PROGRA~1/R/R-31~1.0/include" -DNDEBUG
-I"C:/MySQL_5.6"/include
 -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall
-std=gnu99 -mt
une=core2 -c RS-DBI.c -o RS-DBI.o
RS-DBI.c: In function 'RS_DBI_makeSQLNames':
RS-DBI.c:1197:7: warning: array subscript has type 'char'
[-Wchar-subscripts]
       if(!isalpha(c) && c!='"') *name = 'X';
       ^
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]
   char   *c;
           ^
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.0/include" -DNDEBUG
-I"C:/MySQL_5.6"/include
 -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall
-std=gnu99 -mt
une=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]
     Sint   *fld_nullOk, completed;
             ^
RS-MySQL.c: In function 'RS_DBI_invokeBeginGroup':
RS-MySQL.c:1137:30: warning: variable 'val' set but not used
[-Wunused-but-set-v
ariable]
     s_object *s_group_name, *val;
                              ^
RS-MySQL.c: In function 'RS_DBI_invokeNewRecord':
RS-MySQL.c:1158:20: warning: variable 'val' set but not used
[-Wunused-but-set-v
ariable]
     s_object *df, *val;
                    ^
RS-MySQL.c: In function 'RS_MySQL_dbApply':
RS-MySQL.c:1219:38: warning: variable 'fld_nullOk' set but not used
[-Wunused-bu
t-set-variable]
     Sint   i, j, null_item, expand, *fld_nullOk, completed;
                                      ^
gcc -m64 -shared -s -static-libgcc -o RMySQL.dll tmp.def RS-DBI.o
RS-MySQL.o C:/
MySQL_5.6/bin/libmySQL.dll -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64
-Ld:/
RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-31~1.0/bin/x64 -lR
installing to C:/Users/Ashutosh/Documents/R/win-library/3.1/RMySQL/libs/x64
** R
** inst
** preparing package for lazy loading
Warning: package 'DBI' was built under R version 3.1.1
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
** testing if installed package can be loaded
--- Output coming from .Rprofile in "~" directory ---
Welcome at Wed Jul 23 23:57:36 2014
Set "JAVA_HOME" environment variable to empty (for rJava purposes)

Let's not kid ourselves: the most widely used piece of software for
statistics
is Excel.
   -- Brian D. Ripley ('Statistical Methods Need Software: A View of
      Statistical Computing')
      Opening lecture RSS 2002, Plymouth (September 2002)

Warning: package 'DBI' was built under R version 3.1.1
MYSQL_HOME defined as C:/MySQL_5.6

Goodbye at  Wed Jul 23 23:57:38 2014
* DONE (RMySQL)

Goodbye at  Wed Jul 23 23:57:38 2014


Seems as if all is well with this installation, but actually using it seems
to fail. Specifically, I tried running the following commands in RStudio:

> db <- dbConnect(MySQL(), user = "genome", host = "genome-mysql.cse.ucsc.edu")> result <- dbGetQuery(db, "show databases;")Error in if (dbHasCompleted(rs)) { : argument is of length zero


There seems to be an issue with the code installed using this method, which
is puzzling since I presume others are able to successfully use the RMySQL
package.


If anyone can provide guidance with this installation process, I would
greatly appreciate it. (Sorry in advance for the verbose output!!)

Thanks,
Ashutosh Nanda

	[[alternative HTML version deleted]]

