无需超级用户访问权限即可创建Cpanel API数据库 [英] Cpanel API Database Creation with out root access
本文介绍了无需超级用户访问权限即可创建Cpanel API数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
因此,我正在尝试创建没有root用户访问权限的数据库/用户。这要么是不可能的,要么是我做错了。
So I'm trying to create a database/user with out root access. It's either not possible - or i've done something wrong.
建议?缺少步骤吗?
这是我目前的代码:
include("xmlapi.php");
$xmlapi = new xmlapi($db_host);
$xmlapi->password_auth("".$cpaneluser."","".$cpanelpass."");
$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'));
对任何调用执行print_r都会告诉我Array( [data ] =>数组([结果] => 0 [原因] =>访问被拒绝
)
Doing a print_r of any of the calls just tells me Array ( [data] => Array ( [result] => 0 [reason] => Access denied
)
推荐答案
whm中有一个设置仅允许ssl连接。将其关闭并运行良好。
There was a setting in whm only allowing ssl connections. Turned it off and worked fine.
这篇关于无需超级用户访问权限即可创建Cpanel API数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文