Chapter 7: Using MySQL with Node.js and the mysql JavaScript Client

by Jay Raj

NoSQL databases are all the rage these days, and probably the preferred back end for Node.js applications. But you shouldn't architect your next project based on what's hip and trendy. The type of database you use should depend on the project's requirements. If your project involves dynamic table creation, real-time inserts etc. then NoSQL is the way to go. But on the other hand, if your project deals with complex queries and transactions, then an SQL database makes much more sense.

In this tutorial, we'll have a look at getting started with the mysql module — a Node.js driver for MySQL, written in JavaScript. I'll explain how to use the module to connect to a MySQL ...

Get Your First Week With Node.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.