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 - set privleges on new database

Discussion in 'cPanel Developers' started by willsmelser, Dec 16, 2009.

  1. willsmelser

    willsmelser Member

    Joined:
    Jun 11, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    51
    I was able to use the hook script:
    without a problem.

    In my script I create and populate a couple of databases (via php) with:
    PHP:
    shell_exec('mysql < /path/to/mydbs.sql');
    However, I need to access the
    on localhost to set premissions so the databases will be available for new user. I cannot use
    PHP:
    mysql_connect('localhost','root','pass');
    The connection fails. I cannot see how to do this via PHP. I am looking at Bash right now. Just rather have it all working in one language.

    NOTE:
     
  2. willsmelser

    willsmelser Member

    Joined:
    Jun 11, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    51
    Solution using command line

    well, Ive been messing with this for hours when I finally posted, and of course minutes later I got a command line solution.

    user the '-e' parameter
    I should be able to roll that into the php shell_exec() method.

    NOTE:This will work when logged in as root. Look at -u, -p or --user=, --pass= for non root implamentation.
     
Loading...
Similar Threads - postwwwacct privleges database
  1. tgv
    Replies:
    5
    Views:
    804

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