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.

How to get the list of MySQL databases used by an account/domain?

Discussion in 'cPanel Developers' started by rnjoseph, Mar 2, 2011.

  1. rnjoseph

    rnjoseph Registered

    Joined:
    Feb 28, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I need some assistance in getting the list of MySQL databases being used for a particular user account / domain via cpanel API. I have searched for a way to get the list, but no luck so far.

    Does anyone know how to get the list of MySQL databases used for an account? Not all the MySQL databases, but those attached to a particular account alone.

    I expected the MySQL databases names in the output for the following API function:
    DomainUserData < AllDocumentation/AutomationIntegration < TWiki

    But they were absent!

    Hope someone will help me on this.

    Many thanks in advance,
    RN Joseph.
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hello,

    I think you're looking for MysqlFE::listdbs . If you're using it in a cPanel page, take a look at this doc for how to make frontend API2 calls. If you're making the call remotely, look at this doc about invoking API1 and API2 calls via the XML-API. And finally, if you're making a remote call with PHP, you can use the api2_query() method in the XML-API PHP client class.

    If you need any help invoking that call or have any other questions, let me know!

    Best Regards,
    -DavidN
     
  3. rnjoseph

    rnjoseph Registered

    Joined:
    Feb 28, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Exactly, that is what I want. I will try that. If I have any more queries, I will get back to you. Thank you very much.

    RN Joseph.
     
Loading...

Share This Page