>>> 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.
>> 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
> 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 :)
That's it! Problem solved thanks so much Ben and everyone, that's what I did not
I followed above, created same user with different host in a seperate command, and
now I can login via terminal as that user.
So with MySQL, if I understand this correctly,
even if you use the same username with a different host, technically a
same username with a different host is a totally different user?
Going green? See the top 12 foods to eat organic.