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.

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:
    1
    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 cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    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.
     
  3. BraenDead

    BraenDead Member

    Joined:
    Dec 8, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    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