title: MySQL connection issue in gcloud
body: <p>I have deployed codeigniter project in google cloud app engine . I am getting database connection problem. Database connection is below -</p>
  
  <pre><code>$db['default'] = array(
      'dsn' =&gt; 'mysql:unix_socket=/cloudsql/tastyeater-190406:us-central1:tastyeater;dbname= databasename',
      'hostname' =&gt; 'localhost',
      'username' =&gt; 'root',
      'password' =&gt; '********',
      'database' =&gt; 'databasename',
      'dbdriver' =&gt; 'mysqli',
      'dbprefix' =&gt; '',
      'pconnect' =&gt; FALSE,
      'db_debug' =&gt; (ENVIRONMENT !== 'production'),
      'cache_on' =&gt; FALSE,
      'cachedir' =&gt; '',
      'char_set' =&gt; 'utf8',
      'dbcollat' =&gt; 'utf8_general_ci',
      'swap_pre' =&gt; '',
      'encrypt' =&gt; FALSE,
      'compress' =&gt; FALSE,
      'stricton' =&gt; FALSE,
      'failover' =&gt; array(),
      'save_queries' =&gt; TRUE
  );
  </code></pre>
  
  <p>I am getting following error -</p>
  
  <blockquote>
    <p>mysqli::real_connect(): (HY000/2002): Unable to find the socket
    transport "unix" -</p>
  </blockquote>
  
  <p>did you forget to enable it when you configured PHP?</p>
  
  <p>If I change hostname "localhost" by instance IP address then I am getting following error - </p>
  
  <blockquote>
    <p>message: mysqli::real_connect(): (hy000/2002): connection timed out</p>
  </blockquote>
  
  <p>Please help.</p>