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

finitor

Registered
Oct 2, 2009
3
0
51
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
 

finitor

Registered
Oct 2, 2009
3
0
51
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.
 

boteeka

Registered
Apr 8, 2010
1
0
51
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?
 

finitor

Registered
Oct 2, 2009
3
0
51
It was fixed automatically when i upgraded to 11.25.
I have no idea what caused the issue.

Good luck.