title: Error in insertion:connect ECONNREFUSED
body: <p>I'm trying to insert a value into my database, which is mydb and the table is login with 2 fields username and password. I'm using express.js and MySQL. The code of insert query is </p>
  
  <pre><code>exports.insert = function(req,res){
      client.query('insert into' +TABLE+ ' SET username=?,password=?' 
                  , [req.body.txtUser,req.body.txtPassword]
                  , &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    
                    function(err,result){  
                       if(err){
                               console.log("error in insertion:"+ err.message);   
                               }
                       else{
                            console.log("query executed");
                            res.json("data inserted");
                            }
                        } 
                   );
               }
  </code></pre>
  
  <p>When I start the server it starts normal;y and show me the message:</p>
  
  <blockquote>
    <p>The Express server listening on port 3000 in development mode</p>
  </blockquote>
  
  <p>But,  when I visit the signup page and insert the value and press submit the following error is generated </p>
  
  <blockquote>
    <p>error in insertion:connect ECONNREFUSED</p>
  </blockquote>
  
  <p>Can anyone help me out?</p>