title: Connecting Google Cloud SQL with Wordpress on Google Compute Engine
body: <p>I've been running a successful Wordpress install on Google Compute Engine with Nginx, Php-fpm and Mysql.</p>
  
  <p>I noticed you can also run Wordpress on App Engine with a Cloud SQL connection as mentioned here <a href="https://developers.google.com/appengine/articles/wordpress?hl=en" rel="nofollow">https://developers.google.com/appengine/articles/wordpress?hl=en</a></p>
  
  <p>I want to use Wordpress on Compute Engine with the db running on Cloud SQL.</p>
  
  <p>On AppEngine, you need to put the following lines in the wp-config.php file</p>
  
  <pre><code>if(isset($_SERVER['SERVER_SOFTWARE']) &amp;&amp; strpos($_SERVER['SERVER_SOFTWARE'],'Google App      Engine') !== false) {
    define('DB_HOST', ':/cloudsql/YOUR_PROJECT_ID:wordpress_db_name');F
  }else{
    define('DB_HOST', 'localhost');
  }
  </code></pre>
  
  <p>Is there a similar way to connect Wordpress on Compute Engine with Cloud SQL?</p>