Search code examples
mysqlnode.jsherokussh-tunnel

How can i connect to MYSQL database using SSH tunneling from NodeJS?


Note:

  1. I am using password for authentication to SSH server.
  2. Running Windows OS.
  3. Also need to deploy the application in Heroku later.

Solution

  • I used tunnel-ssh npm package to creating a tunnel and then successfully created mysql connection.

    Later, when I deployed my app to Heroku, everything was working fine.