Skip to main content

WHM Database Creation / Config

Comments

3 comments

  • cPanelMichael
    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.
    0
  • lewisstevens1
    Hi, problem is, i cannot find any references on creating the database, i use: [QUOTE]$query = "https://".$ip_address2.":2087/json-api/createacct"; $query .= "?username=".$new_user4; $query .= "&password=".$new_password; $query .= "&domain=".$new_user2.$domain_ext; $query .= "&contactemail=lewis@tomlewismedia.co.uk"; $query .= "&plan=".$server_package2; $query .= "&cgi=0"; $curl = curl_init(); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0); curl_setopt($curl, CURLOPT_HEADER,0); curl_setopt($curl, CURLOPT_RETURNTRANSFER,1); $header[0] = "Authorization: Basic " . base64_encode($whmusername.":".$whmpassword) . "\n\r"; curl_setopt($curl, CURLOPT_HTTPHEADER, $header); curl_setopt($curl, CURLOPT_URL, $query); $result = curl_exec($curl); if ($result == false) { echo "0"; // Installation Failed } else { echo "1"; // Installed //include_once('../setup_files/installation_query.php'); } curl_close($curl);
    This generates the account ect. but doesnt create the database.. and i cannot find any documentation on creating a database, even here.. [url=http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/XmlApi]XML and JSON APIs
    0
  • cPanelMichael
    [quote="lewisstevens1, post: 1492441">his generates the account ect. but doesnt create the database.. and i cannot find any documentation on creating a database, even here.. [url=http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/XmlApi]XML and JSON APIs
    While outdated, you can use API1 functions for MySQL, documented at: ApiMySQl - cPanel Thank you.
    0

Please sign in to leave a comment.