Skip to content
Prev 302897 / 398503 Next

RMySQL dbConnect issues

Hello,

I have access to my database via command line and through workbench, and 
have access on the grant tables:

mysql> SELECT host,user,password,select_priv,insert_priv FROM user;
+------+-------+-------------------------------------------+-------------+-------------+
| host | user  | password                                  | select_priv 
| insert_priv |
+------+-------+-------------------------------------------+-------------+-------------+
| %    | adick | *D2D62126137364E6FDFD43E4887123C99C4C6B57 | Y           
| Y           |
| %    | root  | *D2D62126137364E6FDFD43E4887123C99C4C6B57 | Y           
| Y           |
+------+-------+-------------------------------------------+-------------+-------------+
2 rows in set (0.00 sec)


But when I run the following:

 > library(RMySQL)
Loading required package: DBI
 > drv = dbDriver("MySQL")
 > con = dbConnect(drv, user="adick", password = "***", dbname="***", 
host="***")
Error in mysqlNewConnection(drv, ...) :
   RS-DBI driver: (Failed to connect to database: Error: Access denied 
for user 'adick'@'host' (using password: YES)
)

Further, this error is sporadic. For example, it ran successfully 
yesterday afternoon. I have installed two MySQL databases on two 
separate computers and am having the same problems. Tried restarting 
computers/databases etc. Also, there are no limits to these users on 
number of connections etc. I am completely stumped at this point.

R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

Anthony