[R] Error with RMySQL

Ashim Kapoor @@h|mk@poor @end|ng |rom gm@||@com
Thu Oct 28 10:08:49 CEST 2021


Dear Jim,

Many thanks. I will try your suggestion and come back to you.

Many thanks,
Ashim

On Thu, Oct 28, 2021 at 1:25 PM Jim Lemon <drjimlemon using gmail.com> wrote:
>
> Hi Ashim,
> I was out for a while. I would first try to restart MySQL, then if
> that didn't fix it, try logging in as root and accessing the database.
> While I can't debug this at a distance, I'm pretty sure that the
> database thinks that you aren't authorized to access it. If the
> restart works, your problem is solved. If you have to log in as root,
> it's more difficult to know how this happened.
>
> Jim
>
> On Thu, Oct 28, 2021 at 6:13 PM Ashim Kapoor <ashimkapoor using gmail.com> wrote:
> >
> > Dear Jim,
> >
> > Can you please help me? I am a little confused here.
> >
> > Best,
> > Ashim
> >
> > On Thu, Oct 28, 2021 at 11:30 AM Ashim Kapoor <ashimkapoor using gmail.com> wrote:
> > >
> > > Dear Jim,
> > >
> > > > That error means that your user number or group is not allowed to
> > > > access it. Did you create the new one as a different user, maybe as
> > > > root?
> > >
> > > Here is what I did:
> > >
> > > I switched to root in the MySQL Server, created a new user called
> > > user2. I GRANTed user2 all permissions to access db2. I did NOT
> > > restart the mysql server as I think the GRANT  does not need a restart
> > > of the MySQL server.
> > >
> > > > Jim
> > > >
> > > > On Thu, Oct 28, 2021 at 4:42 PM Ashim Kapoor <ashimkapoor using gmail.com> wrote:
> > > > >
> > > > > Dear R - users,
> > > > >
> > > > > I have 2 databases on a MySQL server. I am able to access the old one
> > > > > but not the freshly created one.
> > > > >
> > > > > library(RMySQL)
> > > > > # This one is the old one, I am able to access it,
> > > > > > con1<- dbConnect(MySQL(),host= "myserver", db="db1", user= "user1",password ="mypass1")
> > > > >
> > > > > # This is the new one. I am getting an error.
> > > > > > con2 <- dbConnect(MySQL(),host= "myserver", db="db2", user= "user2",password="mypass2")
> > > > > Error in .local(drv, ...) :
> > > > >   Failed to connect to database: Error: Access denied for user
> > > > > 'user2'@'myserver' (using password: YES)
> > > > > >
> > > > >
> > > > > Can someone please point me in the right direction? The error is not
> > > > > clear. I do not think I have mistyped the credentials.
> > > > >
> > > > > Many thanks,
> > > > > Ashim
> > > > >
> > > > > ______________________________________________
> > > > > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > > > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > > > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > > > > and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list