Hi all, This is a potentially very stupid question about MySQL <-> R interaction, but I have not been able to solve it. I'm just trying to connect R to my MySQL databse, and gets this:> library(RMySQL)Loading required package: methods> m <- dbDriver("MySQL") > con <- dbConnect(m,group="testdb")Process R segmentation fault at Wed Oct 16 07:04:30 2002 My .my.conf contains this: [client] user = zak host = localhost password=<something> [rs-dbi] database = sdata [testdb] host = localhost database = testDB and connecting through the mysql client is no problem using those settings: $ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 34 to server version: 3.23.49-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use testDB Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> show tables; +------------------+ | Tables_in_testDB | +------------------+ | pet | +------------------+ 1 row in set (0.00 sec) mysql> What's wrong with my setup that's causing R to segfault (but not mysql client)? Any ideas? /Fredrik -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
It's very hard to debug someone else's machine, not least when you haven't even told us the OS you are using. In general you need to get a symbolic debugger (e.g. gdb) into use to investigate this sort of problem. However, a version mismatch between the RMySQL compilation and the MySQL installation has caused this for me. Looks like the MySQL shared libraries are not always compatible when their version numbers suggest they should be, and after a MySQL upgrade I needed to reinstall RMySQL. On Wed, 16 Oct 2002, Fredrik Karlsson wrote:> Hi all, > > > This is a potentially very stupid question about MySQL <-> R > interaction, but I have not been able to solve it. > I'm just trying to connect R to my MySQL databse, and gets this: > > > library(RMySQL) > Loading required package: methods > > m <- dbDriver("MySQL") > > con <- dbConnect(m,group="testdb") > > Process R segmentation fault at Wed Oct 16 07:04:30 2002 > > My .my.conf contains this: > > [client] > user = zak > host = localhost > password=<something> > > [rs-dbi] > database = sdata > > [testdb] > host = localhost > database = testDB > > and connecting through the mysql client is no problem using those > settings: > > $ mysql > Welcome to the MySQL monitor. Commands end with ; or \g. > Your MySQL connection id is 34 to server version: 3.23.49-log > > Type 'help;' or '\h' for help. Type '\c' to clear the buffer. > > mysql> use testDB > Reading table information for completion of table and column names > You can turn off this feature to get a quicker startup with -A > > Database changed > mysql> show tables; > > +------------------+ > | Tables_in_testDB | > +------------------+ > | pet | > +------------------+ > 1 row in set (0.00 sec) > > mysql> > > > What's wrong with my setup that's causing R to segfault (but not mysql > client)? > Any ideas? > > /Fredrik > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- 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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Just curious, does the function dbDriver exist in RMySQL? I usually use dbManager.>>m <- dbDriver("MySQL") >>con <- dbConnect(m,group="testdb") >> >>/Danar. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Danardono wrote:> Just curious, does the function dbDriver exist in RMySQL? > I usually use dbManager. > > >>m <- dbDriver("MySQL") > >>con <- dbConnect(m,group="testdb") > >> > >> > /Danar. > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._There has been a change in function names in the new RMySQL 0.5-0 version (also in the new ROracle and RSQLite). The reason is that the R-SIG-DB has agreed on a common interface to all databases, and as part of this new common interface, most functions have been renamed. The following simple name mapping may help you upgrade existing code to the new DBI: pre-DBI DBI 0.1-4 ---------------------- ---------------------------------- dbManager dbDriver dbConnect dbConnect dbExecStatement dbSendQuery dbExec dbSendQuery quickSQL dbGetQuery fetch fetch getTables dbListTables getConnections dbListConnections getResultSets dbListResults getConnection dbGetConnection getFields dbColumnInfo # for a result set getFields dbListFields # for a table name in a conn getStatement dbGetStatement getRowsAffected dbGetRowsAffected getRowCount dbGetRowCount hasCompleted dbHasCompleted getInfo dbGetInfo describe summary getTableFields dbListFields getTable dbReadTable assignTable dbWriteTable existsTable dbExistsTable SQLDataType dbDataType make.SQL.name make.db.name isSQLKeyword isSQLKeyword removeTable dbRemoveTable getException dbGetException load dbDriver unload dbUnloadDriver commit dbCommit rollback dbRollback callProc dbCallProc close dbDisconnect close dbClearResult getVersion NA getCurrentDatabase NA getNumRows NA getNullOk NA getNumCols NA getDatabases NA getTableIndices NA NA dbGetDBIVersion -- David A. James Statistics Research, Room 2C-253 Phone: (908) 582-3082 Bell Labs, Lucent Technologies Fax: (908) 582-3340 Murray Hill, NJ 09794-0636 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi and thank you all for your quick response, Indeed, the version of R I am working on is 1.6.0 on a Debian Woody (stable) system. All the client and server MySQL packages report version 3.23.49-8. According to the MySQL web page, the current stable version of MySQL is 3.23.53. Development release is 4.0.4. Could anyone please advice me on a version of MySQL that does work. For me, the important thing is to get a working MySQL <-> R connection going. Thanks! /Fredrik On Wed, Oct 16, 2002 at 08:55:08AM -0400, David James wrote:> Hi Fredrik, > > I've heard people running Debian having this problem, but > I have only access to solaris, red-hat, and Irix systems. > Could you tell me the exact versions of R (1.6.0, I presume), > MySQL client and server? > > thanks, > > -- > David > > Fredrik Karlsson wrote: > > Hi all, > > > > > > This is a potentially very stupid question about MySQL <-> R > > interaction, but I have not been able to solve it. > > I'm just trying to connect R to my MySQL databse, and gets this: > > > > > library(RMySQL) > > Loading required package: methods > > > m <- dbDriver("MySQL") > > > con <- dbConnect(m,group="testdb") > > > > Process R segmentation fault at Wed Oct 16 07:04:30 2002 > > > > My .my.conf contains this: > > > > [client] > > user = zak > > host = localhost > > password=<something> > > > > [rs-dbi] > > database = sdata > > > > [testdb] > > host = localhost > > database = testDB > > > > and connecting through the mysql client is no problem using those > > settings: > > > > $ mysql > > Welcome to the MySQL monitor. Commands end with ; or \g. > > Your MySQL connection id is 34 to server version: 3.23.49-log > > > > Type 'help;' or '\h' for help. Type '\c' to clear the buffer. > > > > mysql> use testDB > > Reading table information for completion of table and column names > > You can turn off this feature to get a quicker startup with -A > > > > Database changed > > mysql> show tables; > > > > +------------------+ > > | Tables_in_testDB | > > +------------------+ > > | pet | > > +------------------+ > > 1 row in set (0.00 sec) > > > > mysql> > > > > > > What's wrong with my setup that's causing R to segfault (but not mysql > > client)? > > Any ideas? > > > > /Fredrik > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > > Send "info", "help", or "[un]subscribe" > > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ > > -- > David A. James > Statistics Research, Room 2C-253 Phone: (908) 582-3082 > Bell Labs, Lucent Technologies Fax: (908) 582-3340 > Murray Hill, NJ 09794-0636-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Thu, 17 Oct 2002, Fredrik Karlsson wrote:> Hi and thank you all for your quick response, > > Indeed, the version of R I am working on is 1.6.0 on a Debian Woody > (stable) system. All the client and server MySQL packages report version > 3.23.49-8. According to the MySQL web page, the current stable version of > MySQL is 3.23.53. Development release is 4.0.4. > > Could anyone please advice me on a version of MySQL that does work. > For me, the important thing is to get a working MySQL <-> R connection > going.3.23.49 does work. -- 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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._