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