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.

WHM Database Creation / Config

Discussion in 'Database Discussions' 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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,724
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,724
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    While outdated, you can use API1 functions for MySQL, documented at:

    ApiMySQl - cPanel

    Thank you.
     
Loading...

Share This Page