From: Ben Clewett Date: April 21 2008 7:21am Subject: Re: Can't get a login shell for some databases List-Archive: http://lists.mysql.com/mysql/212410 Message-Id: <480C405D.4040407@clewett.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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