Skip to main content

create database without login to cpanel

Comments

2 comments

  • cPanelMichael
    Hello, I moved this post into it's own thread, as the example and thread you are using is over five years old. I suggest using cPanel API 2. Documentation on this module is available at:
    0
  • tecwithquestion
    Try this one password_auth("root","rootpass"); $xmlapi->set_debug(1);//this setting will put output into the error log in the directory that you are calling script from $xmlapi->set_output('array');//set this for browser output //create database $createdb = $xmlapi->api1_query($cpuser, "Mysql", "adddb", array($databasename)); foreach($createdb as $v) { $result = $v['result">; } if ($result == 1) { //create user $usr = $xmlapi->api1_query($cpuser, "Mysql", "adduser", array($databaseuser, $databasepass)); } foreach($usr as $v) { $result2 = $v['result">; } if ($result2 == 1) { //add user to database $addusr = $xmlapi->api1_query($cpuser, "Mysql", "adduserdb", array($databasename, $databaseuser, 'all')); } print_r($addusr); ?>
    0

Please sign in to leave a comment.