Re: Users of RDBMS
| From: | Wouter van Vliet | Date: | Fri, 10 Sep 2004 10:06:30 +0000 |
| Subject: | Re: Users of RDBMS | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196284@lists.php.net to get a copy of this message | ||
On Fri, 10 Sep 2004 03:07:35 +0530, Mulley, Nikhil
<mnikhil@corp.untd.com> wrote:
> You can create user from mysql prompt by connecting it through first
> cmd>mysql -h host -u userid -p instance
> password : ******
> then type
> GRANT ALL PRIVILGES ON *.* TO 'newuser'@'host'
> IDENTIFIED BY 'password' with GRANT OPTION;
> where newuser is new users id and host may be either localhost or any other host,if you want to
> add that user to connect from any host then replace 'host' with '%'
> with single quotes.
> and password is new users password.
> Regards
> Nikhil
>
Please, please, please, do not use *.* and with GRANT OPTION for any
user you may want to create. Usually:
> GRANT all ON dbname.* TO newuser@localhost IDENTIFIED BY 'password';
does the trick, while *.* and with GRANT OPTION creates a new
superuser for the database. Also, I'd advice to explicitly specify the
host from which this user is allowed to login (don't use the '%').
Especially when you're creating a superuser ;).