title: Mysql and NodeJS can't connect remotely to deployed app
body: <p>I am trying to connect from a NodeJS app to a MySQL database (already deployed, not in a localhost), currently it throws an error saying:</p>
  
  <pre><code>Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'user'@'187.189.130.120' (using password: YES)
      at Handshake.Sequence._packetToError (C:\wamp\Respaldo Linux\Documentos\WebDev\misGastosApp\node_modules\mysql\lib\protocol\sequences\Sequence.js:48:14)
      at Handshake.ErrorPacket (C:\wamp\Respaldo Linux\Documentos\WebDev\misGastosApp\node_modules\mysql\lib\protocol\sequences\Handshake.js:101:18)
      at Protocol._parsePacket (C:\wamp\Respaldo Linux\Documentos\WebDev\misGastosApp\node_modules\mysql\lib\protocol\Protocol.js:271:23)
      at Parser.write (C:\wamp\Respaldo Linux\Documentos\WebDev\misGastosApp\node_modules\mysql\lib\protocol\Parser.js:77:12)
      at Protocol.write (C:\wamp\Respaldo Linux\Documentos\WebDev\misGastosApp\node_modules\mysql\lib\protocol\Protocol.js:39:16)
      at Socket.&lt;anonymous&gt; (C:\wamp\Respaldo Linux\Documentos\WebDev\misGastosApp\node_modules\mysql\lib\Connection.js:82:28)
      at Socket.emit (events.js:95:17)
      at Socket.&lt;anonymous&gt; (_stream_readable.js:748:14)
      at Socket.emit (events.js:92:17)
      at emitReadable_ (_stream_readable.js:410:10)
      --------------------
      at Protocol._enqueue (C:\wamp\Respaldo Linux\Documentos\WebDev\misGastosApp\node_modules\mysql\lib\protocol\Protocol.js:135:48)
      at Protocol.handshake (C:\wamp\Respaldo Linux\Documentos\WebDev\misGastosApp\node_modules\mysql\lib\protocol\Protocol.js:52:41)
      at Connection.connect (C:\wamp\Respaldo Linux\Documentos\WebDev\misGastosApp\node_modules\mysql\lib\Connection.js:109:18)
      at Object.&lt;anonymous&gt; (C:\wamp\Respaldo Linux\Documentos\WebDev\misGastosApp\app.js:87:12)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
      at Function.Module.runMain (module.js:497:10)
      at startup (node.js:119:16)
  </code></pre>
  
  <p>If I log into my cpanel account and then add my public IP to MySQL remote connections, I am able to connect the app with the MySQL database, but I want to know how could I make it work for when the app is in production. I already read that many users grant all privileges for a user, which already did and still the same (can't connect). </p>
  
  <p>I also read that I could grant remote access to an IP with a wildcard but if I do this, I would need to grant access for all IPs in Mexico? I been reading many things trying to accomplish this connection. My main goal is within production, being able to download the app to my phone (or anyone's phone), then access the app and connect to MySQL. This is because I need constantly check if the data is new and then sync to MySQL. Also I have some doubts if allowing remote MySQL connections would be a security issue?</p>
  
  <p>Note: This is my first app with sync and NodeJS-MySQL, so any advice is really appreciated.</p>