Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2012
    Posts
    91

    Unanswered: Can`t create new user

    I have a database where I would like users to be able to create new users.
    Code:
    GRANT create user ON itest.* TO 'a' IDENTIFIED BY 'a' WITH GRANT OPTION
    My problem is that the line above does not work if I run as a user, even if already has the CREATE USER privilege.
    Error: Error Code: 1221. Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
    How can I allow a normal user to let new users create users?

  2. #2
    Join Date
    Oct 2009
    Location
    221B Baker St.
    Posts
    486
    Typically, security frowns on "people" adding / maintaining other people (users).

    Why is this ok for this situation?

  3. #3
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    The privilege CREATE USER is a global privilege and cannot be assigned for a specific database.
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  4. #4
    Join Date
    Jan 2012
    Posts
    91
    Quote Originally Posted by it-iss.com View Post
    The privilege CREATE USER is a global privilege and cannot be assigned for a specific database.
    Thank You.
    And how assign privilege for a specific database?

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    create the user
    then assign the permissions
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Jan 2012
    Posts
    91
    Can not be create a user to be able to create a new user for a specific database.

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    as It-iss has already pointed out its a two stage process
    first you create the user using CREATE USER
    MySQL :: MySQL 5.1 Reference Manual :: 13.7.1.1 CREATE USER Syntax

    the you assign permisssions to the user using GRANT
    MySQL :: MySQL 5.1 Reference Manual :: 13.7.1.3 GRANT Syntax

    to assign the permissions to another user to create users and assign permissions you would need to assign the CREATE and GRANT OPTION PRIVILEGES

    personally I think its a recipie for disaster allowing other users to create new uSERS AND allow them to assign permissions
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Sep 2012
    Posts
    1

    How can I optimzite the database of Wordpress?

    I have a webiste using Wordpress. How can I optimize the database of Wordpress to make the site run faster?

  9. #9
    Join Date
    Jan 2012
    Posts
    91
    Quote Originally Posted by aliceconer View Post
    I have a webiste using Wordpress. How can I optimize the database of Wordpress to make the site run faster?
    Create a new topic on the forum.

Posting Permissions

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