how to create mysql DB on shared hosting using php script
I need to create a NEW MySQL database, NEW Table, and add users using php script.
I am using Go Daddy Shared Hosting with cPanel Deluxe..
I read that I will need to use UAPI, or XML API or something like that..
I have xmlapi.php in the same directory as my test php file.
I also read that Go Daddy Shared hosting does not allow this to work?
Can anyone help ?
password_auth("".$cpaneluser."","".$cpanelpass."");
$xmlapi->set_port(2082);
$xmlapi->set_debug(1);//output actions in the error log 1 for true and 0 false
$xmlapi->set_output('array');//set this for browser output
//create database
$createdb = $xmlapi->api1_query($cpaneluser, "Mysql", "adddb", array($databasename));
//create user
$usr = $xmlapi->api1_query($cpaneluser, "Mysql", "adduser", array($databaseuser, $databasepass));
//add user
$addusr = $xmlapi->api1_query($cpaneluser, "Mysql", "adduserdb", array("".$cpaneluser."_".$databasename."", "".$cpaneluser."_".$databaseuser."", 'all'));
?>
Please sign in to leave a comment.
Comments
0 comments