Unix Technical Forum

Granting users localhost access

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 ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 05:40 PM
Pam Astor
 
Posts: n/a
Default Granting users localhost access


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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 05:40 PM
Schalk Neethling
 
Posts: n/a
Default Re: Granting users localhost access

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 05:40 PM
Pam Astor
 
Posts: n/a
Default RE: Granting users localhost access


> 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2008, 06:13 AM
Pam Astor
 
Posts: n/a
Default RE: Granting users localhost access


> > 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-20-2008, 06:13 AM
Pam Astor
 
Posts: n/a
Default RE: Granting users localhost access


> > 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-20-2008, 06:13 AM
Schalk Neethling
 
Posts: n/a
Default 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

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!
>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-21-2008, 05:47 AM
Pam Astor
 
Posts: n/a
Default RE: Granting users localhost access




> 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:31 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com