Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    3

    Question Strange behavior of Mysql::adddb (XMLAPI php class)

    Firstly thanks for the useful XMLAPI class. I use it with no problem except the present issue.

    When i create a db using Mysql::adddb function via api1_query it can not be accessed by the root user until i login to Cpanel web interface and list the databases created.
    - I create the database as the root user of a reseller account.
    - I do not create any additional users to access the newly created db.
    - I can see the db listed when i query Mysql::listdbs
    - I can neither see the db listed in phpmyadmin interface nor access it with PHP's mysql functions(giving access denied error).
    - Querying Mysql::updateprivs does not help
    - Giving ALL permissions to root account(which must have them by default) on the database does not help

    The only thing to make it accessible, as mantioned above, is to visit the web interface(frontend/x3/sql/index.html) where the databases are listed. After then, i can see it in phpmyadmin interface or access it using PHP in order to create my tables.

    What is it the web interface is doing and API is missing?

    CPANEL: 11.24.5
    Mysql: 5
    CPanel API: 1

  2. #2
    Registered User
    Join Date
    Oct 2009
    Posts
    3

    Default

    FYI, here is the code:
    Code:
      $xmlapi = new CPXML('127.0.0.1');//renamed the class
      $xmlapi->set_port(2083);
      $xmlapi->password_auth(CP_USER, CP_PASS);
      $xmlapi->return_xml(1);
      return $xmlapi->api1_query(CP_USER, 'Mysql', 'adddb', array('mydbname'));
    Runs and creates the db with no problem.

  3. #3
    Registered User
    Join Date
    Apr 2010
    Posts
    1

    Default

    I have the exact same problem.

    cPanel 11.25.0-R45750 - WHM 11.25.0 - X 3.9
    CENTOS 5.5 x86_64 virtuozzo

    @finitor: If you've found a solution in the meantime would you mind sharing, please?

  4. #4
    Registered User
    Join Date
    Oct 2009
    Posts
    3

    Default

    It was fixed automatically when i upgraded to 11.25.
    I have no idea what caused the issue.

    Good luck.

Similar Threads & Tags
Similar threads

  1. XMLAPI Class on Git Hub
    By rmatakajr in forum cPanel Developers
    Replies: 1
    Last Post: 07-28-2011, 03:09 PM
  2. Strange PHP behavior
    By gilman01 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 10-04-2010, 07:34 PM
  3. XMLAPI php class
    By cPanelMatt in forum cPanel Developers
    Replies: 108
    Last Post: 10-30-2009, 10:11 AM
  4. Strange SSL behavior
    By divisionbyzero in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-04-2008, 09:53 AM
  5. Strange behavior after upgrade
    By echo_bg in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 09-06-2006, 06:01 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube