title: Using cPanel API to create mySQL database and user in PHP
body: <p>I am trying to create a mysql user and assign it to the created database.</p>
  
  <p>I have tried setting $db_host as IP address, FQD, localhost (since I am running from the same server) etc. All of these has no success.</p>
  
  <p>Any advice on what I'm doing wrong? (xmlapi.php is being incuded fine)</p>
  
  <pre><code>include("xmlapi.php");
  $db_host = "usingfullyqualifieddomain";
  $cpuser = "myuser";
  $cppass = "mypass";
  
  $xmlapi = new xmlapi($db_host);
  $xmlapi-&gt;set_port(2083);
  $xmlapi-&gt;password_auth($cpuser,$cppass);
  $xmlapi-&gt;set_debug(1);
  //create database
  print $xmlapi-&gt;api1_query($cpuser, "Mysql", "adddb", 'myDatabaseName');
  //create user
  print $xmlapi-&gt;api1_query($cpuser, "Mysql", "adduser", array('user' =&gt; 'myDBUser','pass'=&gt;'myDBPwd')); 
  </code></pre>