Accessing MySQL databases

9 views
Skip to first unread message

jchristo

unread,
Feb 17, 2010, 2:05:14 PM2/17/10
to Bay Area R Helpers
I am sure this is a dumb question but here goes:

I submit these lines to R:
library(DBI)
library(RMySQL)
con <- dbConnect(dbDriver("MySQL"),username="JAC-PC" ,password=NO ,
dbname="R3Clean2")

And get this result:
Error in mysqlNewConnection(drv, ...) :
RS-DBI driver: (Failed to connect to database:
Error: Access denied for user 'JAC-PC'@'localhost' (using password:
YES))
(Where: JAC-PC is my computer name. I am running Windox XP on a Dell
E520 machine.)

No password I give it will work.
I am a novice at this. Can you help me?
Jon

Ted Dunning

unread,
Feb 17, 2010, 8:43:11 PM2/17/10
to jchristo, Bay Area R Helpers
This sounds like a db configuration issue, not an R issue.

Make sure that you can actually access this database.  You may not have mysql running on your local machine.  It may not have permissions set up for you to access it via that user name.

Try connecting to the database using mysql command line tools.  Think about which host your database is running on.


--
You are subscribed to the Google Groups "Bay Area UseRs!" group.
To post, email to bay-are...@googlegroups.com
To unsubscribe, email bay-area-use-...@googlegroups.com
For more info, visit http://groups.google.com/group/bay-area-use-Rs?hl=en



--
Ted Dunning, CTO
DeepDyve

Murali Nandigama

unread,
Feb 17, 2010, 8:04:06 PM2/17/10
to jchristo, Bay Area R Helpers
You are actually giving a password NO and you are giving it with out quotes around it.

Please replace it with the following string

 library(DBI)
 library(RMySQL)
 con <- dbConnect(dbDriver("MySQL"),username="JAC-PC" ,password="",
dbname="R3Clean2")
On Wed, Feb 17, 2010 at 11:05 AM, jchristo <jonachris...@gmail.com> wrote:
I am sure this is a dumb question but here goes:

I submit these lines to R:

And get this result:
Error in mysqlNewConnection(drv, ...) :
 RS-DBI driver: (Failed to connect to database:
 Error: Access denied for user 'JAC-PC'@'localhost' (using password:
YES))
(Where:  JAC-PC is my computer name. I am running Windox XP on a Dell
E520 machine.)

No password I give it will work.
I am a novice at this. Can you help me?
      Jon
Reply all
Reply to author
Forward
0 new messages