List:General Discussion« Previous MessageNext Message »
From:Daniel Brown Date:April 16 2008 4:59pm
Subject:Re: grant user privileges
View as plain text  
On Tue, Apr 15, 2008 at 9:03 AM, Hiep Nguyen <hiep@stripped> wrote:
> hi all, i have an existing database (internal) with a user named 'admin',
> everything works fine as far as privileges concern.
>
>  i just created a new database (test) and want to grant admin's privileges
> on test as same as internal.
>
>  how do i do this???
>
>  i tried (as root):
>
>  grant all on test.* to 'admin'@'localhost';
>  grant all on test.* to 'admin'@'10.0.0.%';

    GRANT ALL PRIVILEGES ON test.* TO 'admin'@'localhost' IDENTIFIED
BY 'passwordString';
    GRANT ALL PRIVILEGES ON test.* TO 'admin'@'%' IDENTIFIED BY
'passwordString';
    FLUSH PRIVILEGES;

    The first query grants all privileges to admin when accessing the
host locally.  The second query allows you to connect from ANY host.
The third query flushes the old privileges data and ensures that the
updated mysql.users information is used.  Be sure to replace
passwordString with your password.

    If you only want access to be on the Class C private network
subnet for 10.0.0.x (RFC 1918) as well as localhost, then adjust query
#2 to:

    GRANT ALL PRIVILEGES ON test.* TO 'admin'@'10.0.0.%' IDENTIFIED BY
'passwordString';

    .... and then FLUSH PRIVILEGES; again.

-- 
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!
Thread
grant user privilegesHiep Nguyen15 Apr
  • Re: grant user privilegesSrini16 Apr
  • Re: grant user privilegesSebastian Mendel16 Apr
    • Re: grant user privilegesSebastian Mendel17 Apr
  • Re: grant user privilegesDaniel Brown16 Apr
    • Re: grant user privilegesHiep Nguyen16 Apr
      • Re: grant user privilegesDaniel Brown16 Apr