-1

I'm working on some software that has a local database, but also needs access to a database on AWS.

The database is behind a web server, so the way that I need to connect is to create an SSH tunnel to the web server, which will allow me to access the database.

I'm able to make that connection with:

    plink.exe webserverdomain.com -P 22 -l username -i C:\path to file\private.ppk

I need help modifying this to allow me to then use the database connection string in my software to make the connection. I know some port mapping needs to be done, but I can't figure it out.

The local and remote database are both using port 3306, so I'm trying to use 3307 for the remote. I'm basically trying to replicate how heidi sql does this. Any suggestions?

billabrian6
  • 3
  • 1
  • 3

1 Answers1

2
plink.exe webserverdomain.com -P 22 -l username -i C:\path to file\private.ppk -L 127.0.0.1:3307:127.0.0.1:3306

-L [listen-IP:]listen-port:host:port Forward local port to remote address

Jacob Evans
  • 7,636
  • 3
  • 25
  • 55
  • It connects to the web server, but when I try to connect with the ide after running this command I still get nothing. Am I wrong to think that I should be able to open the tunnel and connect to the database with the normal connection info? – billabrian6 Feb 24 '17 at 21:12
  • is your connection info localhost:3307? – Jacob Evans Feb 24 '17 at 21:16
  • I got it working the 2nd 127.0.0.1 needed to be the address for the database server, and the connection string is localhost. Thanks for your help. It wouldn't let me upvote because the account is new so +1. – billabrian6 Feb 24 '17 at 21:28