Skip to content

RMySQL error under Windows Server 2008 64-bit

8 messages · Michael Styer, Brian Ripley

#
Hello,

I'm trying to use RMySQL under Windows Server 2008 64-bit and I 
encounter the following errors. MySQL version 5.0.67 is installed and 
running.

Initially when loading RMySQL I got this error:

 > library("RMySQL")
Error in fun(...) : MySQL is not installed according to a Registry search
In addition: Warning message:
package 'RMySQL' was built under R version 2.8.1
Error : .onLoad failed in 'loadNamespace' for 'RMySQL'
Error: package/namespace load failed for 'RMySQL'

Then I tried setting the environment variable MYSQL_HOME="C:\\Program 
Files\\MySQL\\MySQL Server 5.0\\", which is the installation directory 
for the MySQL installation on this server. After that, when loading 
RMySQL I get this error:

 > library("RMySQL")
Loading required package: DBI
Error : MYSQL_HOME was set but does not point to a directory
In addition: Warning message:
package 'RMySQL' was built under R version 2.8.1
Error : .onLoad failed in 'loadNamespace' for 'RMySQL'
Error: package/namespace load failed for 'RMySQL'

What else should I try to get RMySQL to load correctly?

Thanks very much.

Michael
#
Are you running R on that server?

If not (the most likely answer), you need MySQL on the client.

If yes, I think you need 32-bit MySQL for RMySQL, even with a 64-bit 
server, since R for Windows is 32-bit.  But I've not seen a 64-bit Windows 
install of MySQL.
On Fri, 19 Dec 2008, Michael Styer wrote:

            

  
    
#
Prof Brian Ripley wrote:
Yes, it's all happening on the same server.
That's interesting. It doesn't seem to be reaching an incompatibility 
with the version of MySQL, though. The installation routine for RMySQL 
doesn't seem to be able to find the MySQL installation at all, so I was 
trying to figure out how to make sure it at least found the installation.

Could it be looking for a file that doesn't exist in a 64-bit MySQL 
installation? That seems unlikely but I suppose it is possible.

Michael
#
Michael Styer wrote:
OK, some further results. I set MYSQL_HOME="C:/Program Files/MySQL/MySQL 
Server 5.0". Sys.getenv("MYSQL_HOME") was escaping the 
double-backslashes in the value I used before.

Now RMySQL is able to find the installation, but I think we do run into 
an incompatibility with 64-bit MySQL at this point. Trying to load the 
RMySQL library I get this error:

   > library("RMySQL")
   Loading required package: DBI
   Error in inDL(x, as.logical(local), as.logical(now), ...) :
     unable to load shared library 
'C:/PROGRA~2/R/R-28~1.0/library/RMySQL/libs/RMySQL.dll':
     LoadLibrary failure:  %1 is not a valid Win32 application.


   In addition: Warning message:
   package 'RMySQL' was built under R version 2.8.1
   Error : .onLoad failed in 'loadNamespace' for 'RMySQL'
   Error: package/namespace load failed for 'RMySQL'

The file RMySQL.dll does exist in that location, but it fails to load. 
This is beyond my knowledge; would that be because it needs a 32-bit 
version of MySQL to load correctly?

Thanks for your help.

Michael
#
On Fri, 19 Dec 2008, Michael Styer wrote:

            
Yes, it does.  A 64-bit installation should not be under Program Files (at 
least on the systems I've seen), so install a 32-bit application somewhere 
else.
#
Prof Brian Ripley wrote:
OK, thanks. This is the first 64-bit Windows machine I've worked with 
myself. It seems to install 64-bit apps in Program Files and 32-bit apps 
in Program Files (x86).

I'm downloading the 32-bit version as we speak; I'll try installing that 
and pointing R to that installation.

Thanks for your help.

Michael
#
Michael Styer wrote:
And that works. At least, RMySQL loads; I'm not sure what limitations 
there are when using a 32-bit MySQL client with a 64-bit server, but 
that's a question for a different list.

Thank you for your assistance.

Michael
#
On Fri, 19 Dec 2008, Michael Styer wrote:

            
None that I know of: we do it all the time on Linux.