[R-sig-DB] RMySQL problem - inherited dbConnect method missing for MySQL

Dan Rie dr|e @end|ng |rom port|o||o|nte|||gence@com
Thu Oct 19 15:17:10 CEST 2006


I am hoping that you can help me resolve a problem I am having using RMySQL.
I've searched the R help news archives, but RMySQL appears to be so trouble
free that there are remarkably few problems reported there, and none that
appear to be related to mine.

I am trying to use RMySQL_0.5-7 on a Windows XP-Pro machine running
R 2.4.0 and MySQL v5.0.26.

I believe that MySQL is installed and working properly (I an able to use
MySQL in Python through MySQLdb without any difficulty), but it's possible
that I have some configuration issue causing the problem described below.
The MySQL server is running on the same machine that is running R.

I have been working from the windows binary installation package
RMySQL_0.5-7.zip.  I have installed it from the R Packages menu using
"Install package(s) from local zip files...".   I have tried various
combinations of adding Path references pointing to the folder with
libmysql.dll and libmysql.lib using references pointing to the MySQL
distribution version of these files and/or pointing to the RMySQL version of
the files (which are a bit older than those in C:\Program Files\MySQL\MySQL
Server 5.0\lib\opt).  I have also tried copying the three dll files to 
...\R-2.3.0\bin.

The problem if first evident when I attempt to create a connection, but may
actually start when I attempt to create the driver variable.
Here is the R transcript after loading the RMySQL package:

# initialize and create MySQL driver variable
   > m<-dbDriver("MySQL")   #does not create output like example code
   > m
   An object of class "MySQLDriver"
   Slot "Id":
   [1] 3376
# create a DBI connection variable - Error results
   > con <- dbConnect(m,host="localhost", user="Dan", password="abcdef",
dbname="test")
   Error in function (classes, fdef, mtable)  :
               unable to find an inherited method for function "dbConnect",
               for signature "MySQLDriver"
# summary of m indicates another failure to find MySQL specific DBI function
   > summary(m)
   Error in function (classes,  fdef, mtable)  :
               unable to find an inherited method for function "dbGetInfo",
               for the signature "MySQLDriver"
# m in expired state, but perhaps that is natural for uninitialized driver
   > mysqlDriverInfo(m)
   Error in mysqlDriverInfo(m)  : expired MySQLDriver

# some diagnostic checks:
   > z<-.packages()
   > z
   [1] "RMySQL"    "DBI"         "methods"    "stats"    "graphics"
"grDevices"
   [7] "utils"            "datasets"   "base"

   > objects(2)
    [1] "dbApply"                                "dbBuildTableDefinition"
    [3] "ErrorClass"                            "isIDCurrent"
    [5] "MySQL"                                 "mysqlCloneConnection"
    [7] "mysqlCloseConnection"        "CloseDriver"
    [9] "mysqlCloseResult"                "mysqlConnectionInfo"
  [11] "mysqlDataType"                    "mysqlDBApply"
  [13] "mysqlDescribeConnection"  "mysqlDescribeDriver"
  [15] "mysqlDescribeFields"            "mysqlDescribeResult"
  [17] "mysqlDriverInfo"                   "mysqlExecStatement"
  [19] "mysqlFetch"                            "mysqlImportFile"
  [21] "mysqlInitDriver"                    "mysqlNewConnection"
  [23] "mysqlQuickSQL"                   "mysqlReadTable"
  [25] "mysqlResultInfo"                   "mysqlWriteTable"
  [27] "safe.write"                              "usingR"

I have uninstalled, then reinstalled the RMySQL package, but the error
persists.  I'm kind of at a loss as to what to do to fix this problem or
even where to look for clues.  It looks like perhaps the RMySQL.dll is not
being found, but it is in the directory that the zip file indicated
(c:\Program Files\R\R-2.4.0\library\RMySQL\libs), and at least for some
tests, the Path string includes that directory.   I've tried copying the
file RMySQL.dll to the ....\R-2.4.0\bin directory, but no joy there either.

Any help or suggestions that you can provide will be greatly appreciated.

Regards,

Dan Rie
Scituate, MA




More information about the R-sig-DB mailing list