Connecting Node.js and Express to a MySQL Database
Learn how to connect your Node.js application to a MySQL database for querying and inserting data, and integrate this functionality into an Express server.

Sam Meech-Ward
273.5K views • Jun 16, 2022

About this video
I'll show you how to connect your node application to a MySQL database to query and insert data. I will also show you how to integrate this into an express server to show what a complete backend might look like.
Chapters:
0:00 Intro
0:32 Setup MySQL
1:50 Setup Node App
2:46 Connect to MySQL from Node
4:40 Basic Queries
7:24 Environment Variables
10:22 Prepared Statements
13:42 Insert Statement
17:58 Express
26:00 Error Handling
27:28 Summary
🔗Code & Resources:
https://sammeechward.com/connect-to-mysql-from-node
🔗Express JS Crash Course
https://www.sammeechward.com/express-js-crash-course-web-dev-tutorial-for-beginners
🔗Moar Links
My Website: https://www.sammeechward.com
Instagram: https://www.instagram.com/meech_ward
Github: https://github.com/orgs/Sam-Meech-Ward
Chapters:
0:00 Intro
0:32 Setup MySQL
1:50 Setup Node App
2:46 Connect to MySQL from Node
4:40 Basic Queries
7:24 Environment Variables
10:22 Prepared Statements
13:42 Insert Statement
17:58 Express
26:00 Error Handling
27:28 Summary
🔗Code & Resources:
https://sammeechward.com/connect-to-mysql-from-node
🔗Express JS Crash Course
https://www.sammeechward.com/express-js-crash-course-web-dev-tutorial-for-beginners
🔗Moar Links
My Website: https://www.sammeechward.com
Instagram: https://www.instagram.com/meech_ward
Github: https://github.com/orgs/Sam-Meech-Ward
Tags and Topics
Browse our collection to discover more content in these categories.
Video Information
Views
273.5K
Likes
6.8K
Duration
28:03
Published
Jun 16, 2022
User Reviews
4.7
(54) Related Trending Topics
LIVE TRENDSRelated trending topics. Click any trend to explore more videos.