Skip to content
Snippets Groups Projects

JavaScript - NodeJS MySql Connector Example

Description

Example of using a NodeJS JavaScript application to connect to MySQL and make database queries.

Program Setup

First, make sure MySQL is installed and setup on your program. Then install NodeJs and run npm install from project root.

Once that's done, import src/database_export.sql to a new database, and edit config.js to connect to your local MySql instance.

Running the Program

Once the program is setup, use a terminal to cd into project root, then run node app.js.