title: Could not connect to Google cloud SQL. Using PHP Google SDK
body: <p>I did read this tutorial 
  <a href="https://developers.google.com/appengine/docs/php/cloud-sql/" rel="nofollow noreferrer">https://developers.google.com/appengine/docs/php/cloud-sql/</a>
  I had created a Instance with name <code>schoolnbd</code> and my project id is <code>myapplication-2013</code>
  After reading the tutorial I tried the code below</p>
  
  <pre><code>&lt;?php
  $dhost=":/cloudsql/myapplication-2013:schoolnbd";
  $duser="root";
  $dpassword="xxxyyy";
  $database="schoolnbd";
  $connection=mysql_connect($dhost, $duser, $dpassword) or die("Could not Connect to SQL Server Suleman");
  $db=mysql_select_db($database, $connection) or die(" Check the Database Name from Config.php , wrong database entered ");
  ?&gt;
  </code></pre>
  
  <p>But it is showing “Could not Connect to SQL Server Suleman”. 
  I had created one user by name <code>suleman</code> and made several changes , but still it is not connecting to SQL server, i am seeing same message. 
  I had tried doing many changes such as</p>
  
  <p>try 1 </p>
  
  <pre><code>$dhost=":/cloudsql/myapplication-2013:schoolnbd";
  $duser="suleman";
  </code></pre>
  
  <p>try 2</p>
  
  <pre><code>$dhost="localhost";
  $duser="root";
  </code></pre>
  
  <p>try 3</p>
  
  <pre><code>$dhost=":/myapplication-2013:schoolnbd";
  $duser="root";
  </code></pre>
  
  <p>try 4</p>
  
  <pre><code>$dhost=":/cloudsql/myapplication-2013:myapplication-2013:schoolnbd";
  $duser="root";
  </code></pre>
  
  <p>try 5 </p>
  
  <pre><code>$dhost=":/cloudsql/myapplication-2013:myapplication-2013:schoolnbd";
  $duser="suleman";
  </code></pre>
  
  <p>Error from the error log is 
  <code>it is Showing mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) in /base/data/home/apps/s~myapplication-2013/1.371632998623546850/test.php on line 6</code></p>
  
  <p>when I am using </p>
  
  <pre><code>$dhost=":/cloudsql/myapplication-2013:schoolnbd";
  $duser="root";
  </code></pre>