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 at 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 at 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 at 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 at 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 at 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.
Dear Jim, I restarted the mariadb.service but I am STILL not able to access the server. I can access one database from one user but not from another user. The credentials seem to be OK to me. If I can figure this out I will post it here. Many thanks, Ashim On Thu, Oct 28, 2021 at 1:38 PM Ashim Kapoor <ashimkapoor at gmail.com> wrote:> > 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 at 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 at 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 at 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 at 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 at 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.
Dear Jim and others, (One of my colleagues pointed me in this direction) I think the following is the problem that I am experiencing:- https://dev.mysql.com/doc/mysql-security-excerpt/5.7/en/problems-connecting.html The above says : Some permanent solutions are: Determine what is wrong with your DNS server and fix it. Specify IP addresses rather than host names in the MySQL grant tables. I could NOT determine what is wrong with my DNS server. If someone here knows how to do that please do share with me. However, I specified the IP address in place of the host name and that seems to be working fine. Best, Ashim On Thu, Oct 28, 2021 at 2:24 PM Ashim Kapoor <ashimkapoor at gmail.com> wrote:> > Dear Jim, > > I restarted the mariadb.service but I am STILL not able to access the server. > > I can access one database from one user but not from another user. The > credentials seem to be OK to me. > > If I can figure this out I will post it here. > > Many thanks, > Ashim > > On Thu, Oct 28, 2021 at 1:38 PM Ashim Kapoor <ashimkapoor at gmail.com> wrote: > > > > 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 at 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 at 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 at 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 at 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 at 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.