Skip to content

Sample code for executing MySQL commands from NodeJS. Can be used to query MySQL data from AWS Lambda

Notifications You must be signed in to change notification settings

BrockNicholas/NodeToMySQLSample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeToMySQLSample

This is a starting point for connecting to a MySQL table using Node.js. Can be used for connecting from AWS' Lambda to MySQL RDS. Borrowed heavily from https://redstapler.co/aws-lambda-tutorial-rds-mysql/ . This is the starting point I use for new projects, shared in case it helps anyone else.

Directions

  1. If you are new to Node/NPM, you will need to install Node on your machine using a Node version manager: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm#osx-or-linux-node-version-managers

  2. Clone this repository

  3. Enter your config settings in config/conn.json

  4. Set a query to your database in index.js

  5. Run "npm install"

  6. Run "npm start" or "npm test" or "node index.js"

  7. If using Lambda, make sure your function has execution roles for RDS

About

Sample code for executing MySQL commands from NodeJS. Can be used to query MySQL data from AWS Lambda

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published