Pam Astor wrote:
>> The ANSI-SQL syntax is to just use GRANT to create users. You will
>> still need to use GRANT twice for both users: joe@'%' and joe@'localhost'.
>>
>> But I find the MySql syntax for creating user with CREATE USER and then
>> GRANT easier to follow:
>>
>> CREATE USER joe@'%' IDENTIFIED BY 'whateverpassword';
>> CREATE USER joe@'localhost' IDENTIFIED BY 'whateverpassword';
>>
>> GRANT ALL ON db1.* TO joe@'%';
>> GRANT ALL ON db1.* TO joe@'localhost';
>>
>> If you see what I mean...
>>
>> Just remember that a user always has a host, and you should always use
>> the two together.
>>
>> Ben
>
> Thanks Ben,
>
> OK Got it,
>
> One more thing, I have already created these users and don't want to mess their
> passwords up or break their associated php scripts access.
>
> So how do I grant users, who already have a password, localhost
> access?
A user is always paired with a host. Therefore your user @'localhost'
is a new user. You will have to create with same password as existing :)
Ben
>
>
>
> _________________________________________________________________
> Going green? See the top 12 foods to eat organic.
> http://green.msn.com/galleries/photos/photos.aspx?gid=164&ocid=T003MSN51N1653A