How to connect mobile app using node js to a remote mysql database on Godaddy cPanel?

<-- ErrorPacket { fieldCount: 255, errno: 1045, sqlStateMarker: '#', sqlState: '28000', message: 'Access denied for user \'eazy_db\'@\'122.179.102.170\' (using password: YES)' }

Problem with MySQLError: ER_ACCESS_DENIED_ERROR: Access denied for user 'eazy_db'@'122.179.102.170' (using password: YES)

Getting this error when node server is started. 122.179.102.170 is the router ip address instead of my server ip address.

  • If you can SSH into your server that is hosting your DB, type in the following Linux command to get your server's IP Address: ifconfig
  • The response from that command will look like this: Output of ifconfig command
  • Notice the eth0 block. I highlighted it in a blue box.
  • That is the I.P. address of your MySQL server.

If you cannot SSH into the server that is hosting your MySQL database, I recommend following these steps and obtaining the Database Host name from the GoDaddy Console: Setting up an Access Database for Your Hosting Account