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.

cPanel API 2 MysqlFE::createdbuser does not work for WHM version 11.48.0

Discussion in 'cPanel Developers' started by chamithlkml, Feb 10, 2015.

  1. chamithlkml

    chamithlkml Member

    Joined:
    Apr 2, 2014
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Hello,
    I have been using MysqlFE::createdbuser for creating mysql db user for a given database. I was working fine for WHM version < 11.48. But after upgraded into WHM 11.48, this api fails.

    PHP Code I used.
    $mysql_user = "dmspqrs";
    $mysql_pass = "pqrs1234";
    require_once("/usr/local/cpanel/php/cpanel.php");
    $live = new CPANEL();
    $result = $live->api2('MysqlFE', 'createdbuser', array('dbuser' => $mysql_user, 'password' => $mysql_pass));

    Result was

    Array
    (
    [cpanelresult] => Array
    (
    [postevent] => Array
    (
    [result] => 1
    )

    [data] => Array
    (
    )

    [event] => Array
    (
    [result] => 1
    )

    [apiversion] => 2
    [preevent] => Array
    (
    [result] => 1
    )

    [error] => 1
    [func] => createdbuser
    [module] => MysqlFE
    )

    )

    I tried with dbuser={cpanel-user}_pqrs
    but received same response with nor reason for error.
    Please let me know why this happens with WHM version 11.48.0.
    Thanks

    - Chamith
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    652
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    I've not been able to reproduce this issue when testing with the API shell option in cPanel. Can you reproduce this through methods other than the PHP script you are using?

    Thank you.
     
Loading...

Share This Page