title: Connecting nodejs to google cloud SQL
body: <p>I am trying to connect an instance of nodejs to my google cloud SQL database. its failing.</p>
  
  <p>I run the command</p>
  
  <pre><code>node server.js
  </code></pre>
  
  <p>and get the error</p>
  
  <pre><code>Problem with MySQL Error: connect ENETUNREACH
  </code></pre>
  
  <p>here is my server.js file</p>
  
  <pre><code>var gcloud = require("gcloud");
  var express = require("express");
  var mysql = require("mysql");
  var app = express();
  var connection = mysql.createConnection({
  host : "2001:****:****:*:****:****:****:****",
  user : "root",
  password : "*****",
  database : "scripto_5_k"
  });
  /* Connection to Database */
  connection.connect(function(error){
  if(error)
  {
  console.log("Problem with MySQL "+error);
  }
  else
  {
  console.log("Connected with Database ");
  }
  });
  /*start the server */
  app.listen(3000,function(){
  console.log("its started on PORT 3000");
  });
  </code></pre>
  
  <p>I have gone to my sql database in the developers console and allowed the ip address of my home and the node js instance but I cant seem to find the problem.</p>
  
  <p>Any help is really appreciated.</p>
  
  <p><strong>Update 1</strong></p>
  
  <p>I pinged the IPv6 address with this result</p>
  
  <pre><code>C:\Users\joe&gt;ping 2001:****:****:*:****:****:****:****
  
  Pinging 2001:****:****:*:****:****:****:**** with 32 bytes of data:
  Request timed out.
  Request timed out.
  Request timed out.
  Request timed out.
  
  Ping statistics for 2001:****:****:*:****:****:****:****:
  Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
  </code></pre>
  
  <p>But I have taken the ip from the properties in the sql tab on gcloud. </p>