Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Nov 2002
    Posts
    1,781
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default list of dbs for users

    Hi,

    I am looking for help on getting list of databases for a setup of cpanel users. Basically we want to create a small internal app, which takes a particular list of users, goes in each account, get a list of their respective databases, and back them up.

    I know we can backup all databases, its much easier, but we to only backup for a set of users, and these users keep on adding more dbs to the server, so the only way it will work flawlessly is via the api.

    Any help would be appreciated.

    Thanks
    :: Anand ::

    ssh root@
    who the hell is root ???

    Cpanelappz Support Forums are up now. Register Today
    http://forums.cpanelappz.com

    WHM/cPanel API : http://whmapi.cpanelappz.com
    Cpanel Login Script : www.cpanelappz.com/cpanel-login-script.htm
    Exiscan+Clam+Exim Auto Installer : www.cpanelappz.com

  2. #2
    cPanel Staff cPanelMatt's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default Re: list of dbs for users

    This should be done rather easily via the API2 MysqlFE::listdbs call. To call this you would use a URL like:

    Code:
    /xml-api/cpanel?cpanel_xmlapi_module=MysqlFE&cpanel_xmlapi_func=listdbs&cpanel_xmlapi_user=$username
    . At this point, it should return an XML list of the databases that belong to that user and you can kick off a "dump" process from there.

    There are a few libraries that can assist you with this, please see http://github.com/CpanelInc for a listing of them (perl and PHP)

    Please let me know if you have any more questions/problems that we can assist you with.
    Matt Dees
    Integration Developer
    cPanel, Inc.
    cPanel Integration Blog

  3. #3
    Member
    Join Date
    Nov 2002
    Posts
    1,781
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Re: list of dbs for users

    Great, let me try it out.

    Thanks
    :: Anand ::

    ssh root@
    who the hell is root ???

    Cpanelappz Support Forums are up now. Register Today
    http://forums.cpanelappz.com

    WHM/cPanel API : http://whmapi.cpanelappz.com
    Cpanel Login Script : www.cpanelappz.com/cpanel-login-script.htm
    Exiscan+Clam+Exim Auto Installer : www.cpanelappz.com

  4. #4
    Member
    Join Date
    Nov 2002
    Posts
    1,781
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Re: list of dbs for users

    Got it working like the way we wanted. Thanks for help.
    :: Anand ::

    ssh root@
    who the hell is root ???

    Cpanelappz Support Forums are up now. Register Today
    http://forums.cpanelappz.com

    WHM/cPanel API : http://whmapi.cpanelappz.com
    Cpanel Login Script : www.cpanelappz.com/cpanel-login-script.htm
    Exiscan+Clam+Exim Auto Installer : www.cpanelappz.com

Similar Threads & Tags
Similar threads

  1. MySQL dbs and users dissapered from 2082
    By onscreen in forum cPanel and WHM Discussions
    Replies: 21
    Last Post: 01-08-2011, 11:31 PM
  2. Errors in MySQL Log regarding dbs/users that don't exist
    By sneader in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 06-12-2009, 09:21 AM
  3. mailing list detached from users account?
    By Sheldon in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-21-2004, 12:43 PM
  4. unable to list ftp users in cpanel
    By mack28 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 11-03-2003, 07:30 AM
  5. Users added to many DBs and can't remove
    By Trel in forum cPanel and WHM Discussions
    Replies: 18
    Last Post: 07-13-2003, 06:22 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube