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!

WHM Database Creation / Config

Discussion in 'Database Discussion' started by lewisstevens1, Oct 28, 2013.

  1. lewisstevens1

    lewisstevens1 Member

    Joined:
    Oct 18, 2013
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello i was just wondering if there's any PHP way of CREATING A DATABASE, CREATE A NEW MYSQL USER (Username & Password), ASSIGN THE USER TO THE DATABASE?

    I know how to create tables, but i would like to add the databases automatically via a script so that i dont have to go in and configure a database everytime a new account is created.

    The attached image shows what process i would like automated via PHP.

    Many thanks
    Lewis:D

    database.jpg
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,962
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    You could utilize our API for database functions. This is documented at:

    cPanel - Software Development Kit

    You can also search our forums for a term such as "API create database" and find several results.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. lewisstevens1

    lewisstevens1 Member

    Joined:
    Oct 18, 2013
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi, problem is, i cannot find any references on creating the database, i use:
    This generates the account ect. but doesnt create the database.. and i cannot find any documentation on creating a database, even here.. XML and JSON APIs
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,962
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    While outdated, you can use API1 functions for MySQL, documented at:

    ApiMySQl - cPanel

    Thank you.
     
    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