javascript - Connecting nodejs to google cloud SQL -
i trying connect instance of nodejs google cloud sql database. failing.
i run command
node server.js
and error
problem mysql error: connect enetunreach
here server.js file
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 database */ connection.connect(function(error){ if(error) { console.log("problem mysql "+error); } else { console.log("connected database "); } }); /*start server */ app.listen(3000,function(){ console.log("its started on port 3000"); });
i have gone sql database in developers console , allowed ip address of home , node js instance cant seem find problem.
any appreciated.
update 1
i pinged ipv6 address result
c:\users\joe>ping 2001:****:****:*:****:****:****:**** pinging 2001:****:****:*:****:****:****:**** 32 bytes of data: request timed out. request timed out. request timed out. request timed out. ping statistics 2001:****:****:*:****:****:****:****: packets: sent = 4, received = 0, lost = 4 (100% loss),
but have taken ip properties in sql tab on gcloud.
host address might wrong. have tried ping it?
Comments
Post a Comment