[R] R brakes when submitting a query to MySQL

Zembower, Kevin kzembowe at jhuccp.org
Tue Dec 18 19:18:15 CET 2007


Is it your use of 'con' rather than 'con2' in dbSendQuery? -Kevin

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Marc Moragues
Sent: Tuesday, December 18, 2007 1:14 PM
To: r-help at r-project.org
Subject: [R] R brakes when submitting a query to MySQL

Hello,

I would like to retrieve data stored in MySQL database, so I installed
RMySQL package.
I can successfully connect with the my database using the following code

> dvr<-dbDriver("MySQL")
> con2<-dbConnect(dvr,group="exbardiv")
> mysqlDescribeConnection(con2)

<MySQLConnection:(972,0)> 
  User: mmorag 
  Host: localhost 
  Dbname: exbardiv 
  Connection type: localhost via TCP/IP 
  No resultSet available

I can even see the tables in the database

> dbListTables(con2)
[1] "agoueb"    "high_ld"   "rescue"    "sjlc_info" "sjlc_ld"   "temp"

[7] "temp_snp1" "temp_snp2"

However, when I try to query the database, R breakes.

res<-dbSendQuery(con,'select * from sjlc_ld')

Can anyone help me tune up the connection between R and MySQL?

Thank you,
Marc.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _

SCRI, Invergowrie, Dundee, DD2 5DA.  
The Scottish Crop Research Institute is a charitable company limited by
guarantee. 
Registered in Scotland No: SC 29367.
Recognised by the Inland Revenue as a Scottish Charity No: SC 006662.


DISCLAIMER:\ \ This email is from the Scottish Crop Rese...{{dropped:30}}



More information about the R-help mailing list