Installing MySQL is very simple. Just head to the official website and follow the instructions. You'll usually be asked for a password for the root user, which you can use later on to manage the server settings and user accounts.
There are some options to connect to a MySQL server using Node.js, but the best tools are the mysql and mysql2 modules. They both serve the required purpose, and neither is the next version of the other, they're just a bit different in design and supported features.
First, let's add the dependency to our service. On the terminal, go to our service folder and type:
npm install mysql --save
We can now include our dependency and configure a connection to the database. To avoid having the credentials in our code, ...