API Call sites_database_add

Discussion in 'General' started by Mosquito, Aug 23, 2010.

  1. Mosquito

    Mosquito New Member

    I'm having an issue with 'sites_database_add'. I can get it to add a DB without any issue. I can see it and connect to it via phpMyAdmin. But, when I try to do a mysql_connect call, I get this error:

    Code:
    PHP Warning:  mysql_connect(): Access denied for user 'c7testAPI'@'localhost' (using password: YES)
    
    These are the parameters I'm passing:
    Code:
    $params = array(
    			'server_id' => 1,
    			'type' => 'mysql',
    			'database_name' => 'c7testAPI',
    			'database_user' => 'c7testAPI',
    			'database_password' => 'test',
    			'database_charset' =>  'utf8',
    			'remote_access' => 'n', // n disabled - y enabled
    			'active' => 'y', // n disabled - y enabled
    			'remote_ips' => ''
    		);
    
    Did I miss something?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    If you can connect to it with phpmyadmin with the c7testAPI user, then it is a problem of your test script and not the remoting script as phpmyadmin is a php application that connects to the databse too.
     
  3. Mosquito

    Mosquito New Member

    Is there a delay between the time the API call is made and is returned and the time the database is created?

    I am creating the DB and right after attempting to connect to the new DB. That is when it fails.

    EDIT: To answer my own question - Yes, there is a delay. Put the script to sleep for a minute and it connects just fine.
     
    Last edited: Aug 24, 2010

Share This Page