Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

postwwwacct Auto-create DB, DB User, Grant Access

Discussion in 'General Discussion' started by CreedFeed, Aug 27, 2007.

  1. CreedFeed

    CreedFeed Member

    Joined:
    Jan 22, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    151
    I've created a postwwwacct script in PHP to auto create a database, database user, and grant access to the database for that user. It's not working, however it seems to be inserting all the correct data into the 'mysql' table. When I load my website after creating an account I get an error 'Unable to connect to database, User does not have privileges' error.

    After the account is created and I log into the account's CPanel, all the correct data is displayed - the user was created, the db was created and the user was granted access to the database. When I click on the username to view the permissions it was granted, everything is checked.

    If I click on the "Update" button from the Manage User Privileges page, everything seems to work then. However after doing that all the data in the 'mysql' database table seem to remain the same.

    Any idea what I'm missing? Is there something other than the 'db' table in the 'mysql' database that I have to specify grant access privileges?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. CreedFeed

    CreedFeed Member

    Joined:
    Jan 22, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    151
    I solved my problem - after assigning privileges I had to flush the mysql privileges!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice