Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Problem with Mysql::adddb

Discussion in 'cPanel Developers' started by BraenDead, Feb 23, 2011.

  1. BraenDead

    BraenDead Member

    Joined:
    Dec 8, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    I am having a problem with Mysql::Adddb not creating the user account I am asking it to create. Other commands are working, such as MysqlFE::listdbs (which does display the list of databases). I tested these by accessing them in a browser, just to make sure it is not a code issue, and still it does not work. I am trying to add a database called "account_test", by calling the following in the browser:

    Code:
    https://hostname.com:2087/xml-api/cpanel?user=account&cpanel_xmlapi_module=Mysql&cpanel_xmlapi_func=adddb&cpanel_xmlapi_apiversion=1&dbname=test
    I get the following as a result:

    Code:
    <?xml version="1.0" ?> 
    <cpanelresult>
      <module>Mysql</module> 
      <func>adddb</func> 
      <type>event</type> 
      <source>internal</source> 
      <apiversion>1</apiversion> 
      <data>
        <result /> 
      </data>
      <event>
        <result>1</result> 
      </event>
    </cpanelresult>
    
    For reference, I am running WHM 11.28.83

    Does anyone have any idea why this is not working, or what I need to do to make it work? Thanks, I appreciate any help you can offer.

    Bob

    Edit: I tried using the XML API PHP library as well, and this also didn't create the database. I tested other functions which did work in the XML API PHP library, I just can't get Mysql::adddb to work!
     
    #1 BraenDead, Feb 23, 2011
    Last edited: Feb 23, 2011
  2. MattDees

    MattDees Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    416
    Likes Received:
    1
    Trophy Points:
    243
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    As this is an API1 call, you should change:

    dbname=test

    to

    arg-0=test

    API1 uses order based parameters.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. BraenDead

    BraenDead Member

    Joined:
    Dec 8, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    Thanks - I swear I had tested that as well, but it is certainly working now. I'm wondering if I entered arg-1=test instead of arg-0. Anyways, working now so a big thank you!

    Bob
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice