Monday, 29 May 2017

connect ETIMEDOUT at Connection._handleConnectTimeout below is this code please help.. Thanks in advance

I get this error when I try to connect to mysql database on phpmyadmin from nodejs . 

I am using same port number 3306 that is for mysql.After 4,5 seconds i get this error. I am using mamp free version for this .Please Help !! Thanks in advance

    var express = require('express');
    var bodyParser = require('body-parser');
    var mysql = require('mysql');

    var app = express();

    app.use(bodyParser.json());
    app.use(bodyParser.urlencoded({extended:true}));

    //constants
    const STATUS_SUCCESS = "success";
    const STATUS_FAILURE = "failure";

    mysql
    var connection = mysql.createConnection({
      host     : '172.0.0.1',
      user     : 'root',
      password : 'user',
      database : 'parking_application'
    });

    connection.connect();



    app.listen(4567,'localhost',function(){
      console.log("server started");
    });



via Salil Luley

No comments:

Post a Comment