Connecting to MySQL
Many web applications will dynamically generate content based on the user who is currently accessing them. Many companies desire dynamic web applications so that clients can view data specific to themselves. This is important from a usability and privacy perspective. The application is generally easier to use if it has been personalized to you. If you want to display data for a user, it should be data for that user only rather than all users.
To accomplish this, you must use databases to store the dynamic data you wish to display. Specifically, MySQL integrates well with Node.js, with specific modules written just to work with MySQL. In this section, you will learn how to connect to MySQL databases using Node.js and use these connections to query the databases. This will allow you to write dynamic applications using databases.
You should already have the required connection information from the Prerequisites section in the Preface. The information you will...