title: Getting Error: connect ECONNREFUSED 127.0.0.1:3306
body: <p>I am a beginner to node.js and was following a tutorial on how to set up a node.js server for Android. When I executed this command, <code>nodemon app.js</code> I am getting this error</p>
  
  <pre><code>[nodemon] 1.19.0
  [nodemon] to restart at any time, enter `rs`
  [nodemon] watching: *.*
  [nodemon] starting `node app.js`
  --Server started at port: 8080--
  Error: connect ECONNREFUSED 127.0.0.1:3306
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
      --------------------
      at Protocol._enqueue (F:\soi19\android-login-register-system\server\node_modules\mysql\lib\protocol\Protocol.js:144:48)
      at Protocol.handshake (F:\soi19\android-login-register-system\server\node_modules\mysql\lib\protocol\Protocol.js:51:23)
      at Connection.connect (F:\soi19\android-login-register-system\server\node_modules\mysql\lib\Connection.js:119:18)
      at Object.&lt;anonymous&gt; (F:\soi19\android-login-register-system\server\routes.js:8:4)
      at Module._compile (internal/modules/cjs/loader.js:759:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
      at Module.load (internal/modules/cjs/loader.js:628:32)
      at Function.Module._load (internal/modules/cjs/loader.js:555:12)
      at Module.require (internal/modules/cjs/loader.js:666:19)
      at require (internal/modules/cjs/helpers.js:16:16)
  </code></pre>
  
  <p>I have tried other answers like changing <code>host: 'localhost'</code> to <code>host:'127.0.0.1'</code> and similarly others but none of them are working. Any help would be appreciated.</p>