The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

are there any scripts to add database to account?

Discussion in 'General Discussion' started by unomateo, Mar 3, 2008.

  1. unomateo

    unomateo Active Member

    Joined:
    Jan 14, 2006
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    We are trying to make a database for every new account. We can make the database and the database user, but only the database user appears in cpanel->mysql databases.

    Are there any hooks, scripts, xml-api....anything that will allow us to create a database and user during new account creation.

    Thanks
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    What you can do is create a hook file (/scripts/postwwwacctuser) as described here: http://www.cpanel.net/support/docs/hooks.htm#postwwwuser

    From this, you can use the XML-API to call the appropriate API function that will create a MySQL database. Documentation for this is still in the works, but you can see how the X3 theme calls and uses this API by analyzing the code of:

    /usr/local/cpanel/base/frontend/x3/sql/adduserdb.html
     
Loading...

Share This Page