www.webdeveloper.com
Results 1 to 3 of 3

Thread: MySQL root user

  1. #1
    Join Date
    Jun 2011
    Posts
    10

    MySQL root user

    Hi all,

    I am trying to understand the instructions here:

    http://dev.mysql.com/doc/refman/5.1/en/create-user.html
    http://dev.mysql.com/doc/refman/5.1/en/grant.html


    Must privileges apply to a particular database? What I want to say is 'create a user called Mary and give her all privileges on all future databases', or in other words (if possible), 'create a user called Mary and make her a root user' (I am not sure if there can be more than one root user).

    Thanks

  2. #2
    Join Date
    Oct 2009
    Posts
    658
    You can use wildcards when you grant permissions.

    Root is just another user with all the privileges
    Good Luck

    Santos Systems

  3. #3
    Join Date
    Jul 2010
    Location
    /ramdisk/
    Posts
    865
    Code:
    CREATE USER 'Mary'@'%' IDENTIFIED BY 'a strong password';
    GRANT ALL ON *.* TO 'Mary'@'%';
    It would be nice if you didn't say 'Mary'@'%', but instead narrowed it down to something like.... localhost, or an ip address, or subnet mask.

    There can be more than one root user. 'username'@'host-specification'.
    You can have root@localhost, root@192.168.2.99, root@devsitething.tld, root@your-own-host-spec (yeah that's valid, with the hyphens... good luck resolving it). All of them can have different passwords. I think you can even limit privileges from some root accounts (I would think root@localhost would be the only exception, but then again, you might be able to delete the root@localhost account... I'm not willing to try and find out).
    Last edited by eval(BadCode); 08-14-2012 at 08:38 AM.
    I use (, ; : -) as I please- instead of learning the English language specification: I decided to learn Scheme and Java;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles