Trouble setting up port forwarding in node js to connect to mysql within ec2

283
February 11, 2017, at 07:51 AM

I need to instantiate port forwarding before I can query the mysql instance running on my ec2 instance. I plan on using a Lambda function to run the specific sql query using node js. I also have a key.pem file that I need to authenticate with.

port forwarding command currently looks like:

ssh  -L 3306:MySQL-Host:3306 ec2-user@ec2-host -i key.pem

My problem is, where do I set up the port forwarding command? As a pre-script that runs before the function from the deployment script? Or from within the actual node js function itself before the sql query?

I've ran it in node js file before but that didn't work properly because the function ended up timing out while when the port forwarding server started.

please don't crap on me, this is my first post.

Rent Charter Buses Company
READ ALSO
MySQL Unknown Column, but column exists

MySQL Unknown Column, but column exists

Running the following MySQL Query and am getting this error:

596
Go Back To Beginning Of Month On Input Date MySQL

Go Back To Beginning Of Month On Input Date MySQL

Let's say that I have an input date of "2017-01-31" or "2017-02-28"I want to take this input date and make SQL change it to "2017-01-01" or "2017-02-01"

344
Mobilefirst Database Slow Query Logs

Mobilefirst Database Slow Query Logs

Worklight Slow queries logs which is increasing the CPU Utilization

281