[R] RMySQL connection

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


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

I get the following error in R:

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

the .my.cnf file looks like this:

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

database = s-data

host = localhost
database = mydatabase

More information about the R-help mailing list