[R] RMySQL connection

Sean Davis sdavis2 at mail.nih.gov
Thu Oct 28 12:03:46 CEST 2004


On Oct 28, 2004, at 4:37 AM, R.Alberts wrote:

> 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")

On the mysql server, there is a user named myuser?  The password for 
this user is xxxxxx (or whatever)?  The database is called mydatabase?  
The host for the server is localhost (mysql is running on the same 
machine as R)?  That user/password combination has access to 
mydatabase?

Can you connect from the mysql client on the same machine with those 
settings?

Sean




More information about the R-help mailing list