This is a discussion on Granting users localhost access within the MySQL General forum forums, part of the MySQL category; --> How do I grant users, who already have a password, localhost access? I don’t want to change their passwords ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| How do I grant users, who already have a password, localhost access? I don’t want to change their passwords at this time. __________________________________________________ _______________ Use video conversation to talk face-to-face with Windows Live Messenger. http://www.windowslive.com/messenger...r_video_042008 |
| |||
| Hi there Pam, This should do the trick: update mysql.user set host = 'locahost' where user = 'username' Regards, Schalk Pam Astor wrote: > How do I grant users, who already have a password, localhost > access? I don’t want to change their passwords at this time. > __________________________________________________ _______________ > Use video conversation to talk face-to-face with Windows Live Messenger. > http://www.windowslive.com/messenger...r_video_042008 > > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.23.2/1386 - Release Date: 2008/04/18 05:24 PM |
| |||
| > This should do the trick: > update mysql.user set host = 'locahost' where user = 'username' > Hi Thanks, OK I tried running: update mysql.user set host = 'locahost' where user = 'AUserName'; Substituting AUserName for a real username, got the return: Query OK, 0 rows affected (0.00 sec) Rows matched: 1 Changed: 0 Warnings: 0 and I tried to login and could not log in remotely via a remote terminal, which is what I am trying to do. __________________________________________________ _______________ More immediate than e-mail? Get instant access with Windows Live Messenger. http://www.windowslive.com/messenger...cc ess_042008 |
| |||
| > > OK I tried running:> > > > update mysql.user set host = 'locahost' where user = 'AUserName';> > Substituting AUserName for a real username,> >> > got the return:> > > > Query OK, 0 rows affected (0.00 sec)> > Rows matched: 1 Changed: 0 Warnings: 0> > > > and I tried to login and could not log in remotely via a remote terminal,> > which is what I am trying to do.> > FLUSH PRIVILEGES; I am sorry I do not understand you. If I Flush privilages, will this flush all privilages for the user? If so, I can not do that because these users are already used to log into an existing database via a functioning php script and have privilages to edit tables, etc, and this database is already attached to a live shopping cart php script which is fully functional. When you say flush privilages, don't I also need to include the username for the privilages I am flusing in the command syntax? __________________________________________________ _______________ More immediate than e-mail? Get instant access with Windows Live Messenger. http://www.windowslive.com/messenger...cc ess_042008 |
| |||
| > > I am sorry I do not understand you.> > > > If I Flush privilages, will this flush all privilages for the user?> > If so, I can not do that becausethese users> > are already used to log into an existing database via a functioning php script and have> > privilages to edit tables, etc, and this database is already attached to > > a live shopping cart php script which is fully functional.> > > > When you say flush privilages, don't I also need to include the> > username for the privilages I am flusing in the command syntax?> > FLUSH PRIVILEGES tell MySQL to reload the privilege tables, the one you > edited above,> > but if you say this user is used to connect from aPHP script too, not only > from shell, than you have removed thier privileges to do so, with replacing > the HOST field as Schalk suggested Yes, I said that at least two times in this thread, at least one time priorto your suggesting that I do so. I said earlier that this database was already connected to a live php script if you go back and read the thread. > > > > Do you mean to directly edit the table? How would I do that?> > if you do not even know how to edit a table in MySQL you really should not > mess with mysql tables or privileges at all. I'm trying to learn. Two things - I own the server the database is on, and I also own the store which I am trying to manage. So if I screw up, at least it's my fault and I have learned something. __________________________________________________ _______________ Going green? See the top 12 foods to eat organic. http://green.msn.com/galleries/photo...003MSN51N1653A |
| |||
| Hi Pam, If you want to grant a specific user remote access i.e. from a shell or from an application that resides on a different machine then you will have to adjust the query I sent earlier: update mysql.user set host = '%' where user = 'AUserName'; FLUSH PRIVILEGES; The above two queries will firstly update the mysql database to allow the user specified to connect from any host and will then force the MySQL server to reload the privileges, essentially meaning refresh so that the next time this user tries to connect to the database MySQL will be aware of the change made to the users account and allow them to access the database from a remote host. If you do not want to allow access from any host but for example localhost and a specific IP then you can do: update mysql.user set host = 'localhost, 69.89.2.231' where user = 'AUserName'; FLUSH PRIVILEGES; Regards, Schalk Sebastian Mendel wrote: > Pam Astor schrieb: >>>> OK I tried running:> > > > update mysql.user set host = 'locahost' >>>> where user = 'AUserName';> > Substituting AUserName for a real >>>> username,> > > > got the return:> > > > Query OK, 0 rows affected >>>> (0.00 sec)> > Rows matched: 1 Changed: 0 Warnings: 0> > > > and I >>>> tried to login and could not log in remotely via a remote terminal,> >>>> > which is what I am trying to do.> > FLUSH PRIVILEGES; >> >> I am sorry I do not understand you. >> >> If I Flush privilages, will this flush all privilages for the user? >> If so, I can not do that because these users >> are already used to log into an existing database via a functioning >> php script and have >> privilages to edit tables, etc, and this database is already attached >> to a live shopping cart php script which is fully functional. >> >> When you say flush privilages, don't I also need to include the >> username for the privilages I am flusing in the command syntax? > > FLUSH PRIVILEGES tell MySQL to reload the privilege tables, the one you > edited above, > > but if you say this user is used to connect from a PHP script too, not > only from shell, than you have removed thier privileges to do so, with > replacing the HOST field as Schalk suggested > > >> Do you mean to directly edit the table? How would I do that? > > if you do not even know how to edit a table in MySQL you really should > not mess with mysql tables or privileges at all! > > |
| ||||
| > Date: Sat, 19 Apr 2008 20:06:49 +0200 > From: schalk@alliedbridge.com > To: pamastor@hotmail.com > CC: mysql@lists.mysql.com > Subject: Re: Granting users localhost access > > Hi Pam, > > If you want to grant a specific user remote access i.e. from a shell or > from an application that resides on a different machine then you will > have to adjust the query I sent earlier: > > update mysql.user set host = '%' where user = 'AUserName'; > FLUSH PRIVILEGES; > > The above two queries will firstly update the mysql database to allow > the user specified to connect from any host and will then force the > MySQL server to reload the privileges, essentially meaning refresh so > that the next time this user tries to connect to the database MySQL will > be aware of the change made to the users account and allow them to > access the database from a remote host. > > If you do not want to allow access from any host but for example > localhost and a specific IP then you can do: > > update mysql.user set host = 'localhost, 69.89.2.231' where user = > 'AUserName'; > FLUSH PRIVILEGES; > > Regards, > Schalk Thanks so much Schalk, OK here is what I did – it's still is not working. I ran the command: update mysql.user set host = 'localhost, %' where user = 'myusername';FLUSH PRIVILEGES; I then checked the user table with the command: SELECT * from mysql.user; I find the below entry in the table: | localhost, % | myusername | 0528e2af7e81824b | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 | It appears that the changes took place since both localhost and % are now listed above. I then logged out of root, then tried to log back in with the username that I just updated using login command: mysql -uMyUserName –pMyPassword123 And I still can’t get a login: Access denied for user 'myusername'@'localhost' (using password: YES) Whenever I login as root, I use the command: mysql -uroot –pMyRootPassword12321 __________________________________________________ _______________ More immediate than e-mail? Get instant access with Windows Live Messenger. http://www.windowslive.com/messenger...cc ess_042008 |