RMySQL problem - inherited dbConnect method missing for MySQL
Where did you get RMySQL_0.5-7.zip from? Was it built for R 2.4.0? The symptoms are those of using S4-using packages which have not been reinstalled for R 2.4.0. The current version is RMySQL_0.5-9.tar.gz on CRAN, and I suggest you compile that from the sources.
On Thu, 19 Oct 2006, Dan Rie wrote:
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.
Yours is a recent phenomenon.
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
_______________________________________________ R-sig-DB mailing list -- R Special Interest Group R-sig-DB at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-db
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595