[R] RMySQL connection

R.Alberts r.alberts at biol.rug.nl
Thu Oct 28 10:37:05 CEST 2004


Hi,

I cannot connect to my mysql database from within R using 
RMySQL. What am I doing wrong?

I use linux SuSe 8.1 and R-2.0.0
RMySQL_0.5-5.tar.gz
DBI_0.1-8.tar.gz

I get the following error in R:

> library(RMySQL)
Loading required package: DBI
> m <- dbDriver("MySQL")
> m
<MySQLDriver:(1756)>
> con <- dbConnect(m, group = "mygroup")
Error in mysqlNewConnection(drv, ...) : RS-DBI driver: 
(could not connect myuser at localhost on dbname 
"mydatabase")

the .my.cnf file looks like this:

# this is a comment
[client]
user = myuser
host = localhost
password = xxxxx

[rs-dbi]
database = s-data

[mygroup]
host = localhost
database = mydatabase




More information about the R-help mailing list