building-a-serverless-api-with-nodejs-and-aws-aurora-serverless icon indicating copy to clipboard operation
building-a-serverless-api-with-nodejs-and-aws-aurora-serverless copied to clipboard

Cannot connect to DB locally

Open AmoDinho opened this issue 4 years ago • 2 comments

Hi @adnanrahic ,

In your tut you're able to run your functions locally and connect to the DB. I'm unable to, so I was wondering if you're doing anything special to achieve this?

When I deploy the function I'm able to connect to the DB.

Thanks 🤔

AmoDinho avatar Jul 18 '19 16:07 AmoDinho

Ditto on this matter

antonhalim avatar Oct 02 '19 20:10 antonhalim

Yo @antonhalim so my work around for this is as follows:

  1. I have a regular RDS MYSQL instance that falls under the free tier for when I'm developing locally.
  2. Then I use Aurora serverless for when I ship my app into dev and prod.
  3. So theoretically speaking I have three databases in total for local, dev and prod stages.

Also whatever ORM he was using was giving me issues so I just ended up using Serverless MYSQL

Lastly, if you wanna make raw queries to the regular RDS instance I use MYSQLWorkbench

AmoDinho avatar Oct 03 '19 08:10 AmoDinho