I've watched tons of different coding tutorials, this was by far one of my favorites. You do an amazing job and I hate to see that you haven't added anything in the last few months. Please keep it up, you are very good at explaining things.
This is one of the best tutorials about using MySQL with Node in youtube. I really enjoyed watching your tutorial and gained a lot of usefull knowledge about topic. You really did a great job !
If you see this please pin it or comment and pin your comment. For anyone who gets an error at You have to write "type": "module" in package.json like he did at the beginning of the video, apparently that lets you use "await" without requring to be inside an async function. Also, async works in Express 4 as well, you don't need version 5 to use it.
I just get this error when i run the code at 5:01... const result = await pool.query("SELECT * FROM users"); ^^^^^ SyntaxError: await is only valid in async functions and the top level bodies of modules
You have to write "type": "module" in package.json like he did at the beginning of the video, apparently that lets you use "await" without requring to be inside an async function.
Thanks so much! I LOVE LOVE LOVE how you explain the context of why we write the code a certain way. Helps me out so much knowing background info and prevents me from just following along too blindly!
if you're having a problem with using the Promise API -> await can only be used in an asynchronous function use the module type instead to import 'mysql' -> 2:08
PLEASE HELP MEEEE Can someone help me with this error: (intermediate value) is not iterable router.get('/academic-years', async (req, res) => { try { const [rows] = await db.query(` SELECT academic_year FROM students GROUP BY academic_year HAVING COUNT(*) > 0; `); console.log(rows); const academicYears = rows.map(row => row.academic_year); res.json(academicYears); // ... rest of the code } catch (error) { console.error(error.message); // Log the specific error message res.status(500).send('Error fetching academic years: ' + error.message); // Inform client with details } }); I am not able to use map method to get the unique records since the result is a object what should do?
i can't get it to import express correctly the module it's using is a path to microsoft typescript 5.5 but i have express installed and in my package.json i just can't get it to work
Awesome video. Would like to see one using same languages plus react, and make a full app login and register users, storing the users login information on http only cookies. Show menu links if user is logged in or not.
Thank god someone can actually explain this clearly, comprehensively and concisely - everything I needed to know and nothing I didn't - much appreciated mate 👍
this video is very helpful for me i was looking an video that teach sql and express and start databse and this is what exacly i am looking for if you can give a video baout how to use orm like Drizzle and prisma ✌✌🥰
I love this!! especially the voice of the instructor -- I can listen to it all day! 😀 i was afraid of mysql (connecting it to some front-end code) for a long time and this is super helpful. thank you.
for some reason everything i the video worked but the index.js file inside the mysql2. In the file there syntax errors about "requests not defined". Did i do something wrong along the way or does this happen when you deply it on live server
fantastic ! clear right to the point code , thank you so much . btw how long it took to become this expert 😅 you exactly know what to do in any scenario,
I've been watching a lot of tutorials on connecting MySQL to VSCode and using ExpressJS to implement it. None of the videos gave me a clear idea of what to do. But when I watched your video, you basically made everything clear to me. Just wanted to say thanks for the instructions and keep up the good work.
Man, you don't even know how this video helped me, thank you so much for the didactics and for keeping the language simple for those who aren't natives!
Hey, Thanks for putting this out but I am getting this error 'Access denied for user 'root'@'localhost' (using password: YES)". What could I be doing wrong?
Hey Sam and others, const result = await pool.query('SELECT * FROM notes'); This results empty array for the first array of arrays. Can anyone help me.
what extension are you using that suggests you everytime autocompletion? A whole good query suggested as autocompletion and you used it. Are you kind to tell me which extension are you using please?
I found an application in production and I have been tasked with creating an admin module for it. The DB is already hosted somewhere using PHPMyAdmin (I’m not sure if this statement is correct). How would I connect to it, assuming I have the IP address and the login credentials? Thanks
Hi! Maybe you should have said from the start that this is not a beginner friendly kind of thing. Really struggled to understand anything, but that's what you get for being a beginner in this field. Will come back to this video once I get a better grasp of MySQL. Thank you for now!
When I run the first query as shown in your video with a similar setup, I got an error on the console that says await can only be used inside a function and top-level bodies of modules. I'm using Common JS module System, is this be a problem for this error?
watching this pretty late but I enjoyed every bit of it. I really love how you made the everything connect and how information can be accessed and modified through different channels. great work. Thanks for this.
Sam thank you! So informative and easy to follow. I couldn't find the mySQL install video in the description but I did figure it out. Still didn't know where you were running mySQL commands, I had to use MySQL Workbench.
Fantastic! I really enjoyed this honestly, I kept pausing and rewinding the clip over and over and not because it was hard to grasp rather was your delivery, absolute fire . I am so happy for accidentally coming across your channel you're a real one Sam, Cheers.
hello sir! i have used mongodb atlas for db and I just simply go to railway and deploy my app but how do i do this with mysql? cause mysql db is on my machine right? how to deploy mysql and nodejs server
Dunno How I glad I felt at the very beginning of this tutorial, ever better jajaja dunno how to describe How I felt after complete these almost 30 minutes. Just to try to be accurate, It was in-depth, updated, straightforward MySQL, Node.js and Express master Class...!!! Thank so much!! Sorry I'm not english native speaker But I did my best in order to express my self!!! In a nutshell it was spotless tutorial!!! Thanks Dude! Thanks Sam Meech-Ward!!!!!!!!
I've watched tons of different coding tutorials, this was by far one of my favorites. You do an amazing job and I hate to see that you haven't added anything in the last few months. Please keep it up, you are very good at explaining things.
What is clean code? Hard to define, but you know it when you see it. THIS is CLEAN CODE. Thanks for showing all of us how it's done.
This is one of the best tutorials about using MySQL with Node in youtube. I really enjoyed watching your tutorial and gained a lot of usefull knowledge about topic. You really did a great job !
If you see this please pin it or comment and pin your comment.
For anyone who gets an error at
You have to write "type": "module" in package.json like he did at the beginning of the video, apparently that lets you use "await" without requring to be inside an async function.
Also, async works in Express 4 as well, you don't need version 5 to use it.
Thanks. That had me confused.
This tutorial is amazing! Very straightforward
I can't even wrap my head around on how you packed this much of AMAZING content in such a small video. Hats off to you.
I can't even wrap my head around on how he used await outside async scope
@@vityamv top level await
Thankyou sir loved your video! 🥰
I just get this error when i run the code at 5:01...
const result = await pool.query("SELECT * FROM users");
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
I get the same issue. im not sure how he is not getting the same error. the createpool doesnt seem to be an async function.
It is in an asynchronous function. When declaring the function, he specified ‘async function getNotes() {‘
You have to write "type": "module" in package.json like he did at the beginning of the video, apparently that lets you use "await" without requring to be inside an async function.
Awesome tutorial man, great explanation and good at sharing best practices, some just do stuff without explaining, thank you
Fantastic, to-the-point tutorial. Thank you!
Thanks so much! I LOVE LOVE LOVE how you explain the context of why we write the code a certain way. Helps me out so much knowing background info and prevents me from just following along too blindly!
if you're having a problem with using the Promise API -> await can only be used in an asynchronous function
use the module type instead to import 'mysql'
-> 2:08
using common js ive tried to do require(mysql2/promise) but it still doesnt work
All your tutorials are great to follow on practice without missing out............Awesome attribute you have got!!
Savage! 28 minutes of mindblowing coding, thx dude!
PLEASE HELP MEEEE
Can someone help me with this error:
(intermediate value) is not iterable
router.get('/academic-years', async (req, res) => {
try {
const [rows] = await db.query(`
SELECT academic_year FROM students GROUP BY academic_year HAVING COUNT(*) > 0;
`);
console.log(rows);
const academicYears = rows.map(row => row.academic_year);
res.json(academicYears);
// ... rest of the code
} catch (error) {
console.error(error.message); // Log the specific error message
res.status(500).send('Error fetching academic years: ' + error.message); // Inform client with details
}
});
I am not able to use map method to get the unique records since the result is a object what should do?
delete query was missing
That's your homework I guess
How does this only have 50000 views?????
Now it has 140,000 views
The whole day I have watched your video and finnally solved my issue
i can't get it to import express correctly the module it's using is a path to microsoft typescript 5.5 but i have express installed and in my package.json i just can't get it to work
you're so pretty omg
Amazingly succinct and helpful. You answered all my questions. Thanks
why am I getting RangeError: Maximum call stack size exceeded when I'm trying to access a route from my browser?
Leave a comment?, bro I just subscribed and u have my respect. Thank you
Awesome video. Would like to see one using same languages plus react, and make a full app login and register users, storing the users login information on http only cookies. Show menu links if user is logged in or not.
Thank god someone can actually explain this clearly, comprehensively and concisely - everything I needed to know and nothing I didn't - much appreciated mate 👍
fantastic thank you. I got my app to work just like yours, pretty cool. Please slow down for us newbs :)
Great video, thank you. This was exactly what I was looking for.
This is the best video on the face of this earth
this video is very helpful for me i was looking an video that teach sql and express and start databse and this is what exacly i am looking for if you can give a video baout how to use orm like Drizzle and prisma ✌✌🥰
when i tried the basic queries part it resulted in the only response i was getting was "Promise {pending}" could anyone help me with this?
I love this!! especially the voice of the instructor -- I can listen to it all day! 😀
i was afraid of mysql (connecting it to some front-end code) for a long time and this is super helpful. thank you.
for some reason everything i the video worked but the index.js file inside the mysql2. In the file there syntax errors about "requests not defined". Did i do something wrong along the way or does this happen when you deply it on live server
clear, concise and helpful. Thanks a lot for this nice demonstration, Sam.
you're amazing, thank you for the video and fro giving such a good explanation.
fantastic ! clear right to the point code , thank you so much . btw how long it took to become this expert 😅 you exactly know what to do in any scenario,
I am facing an error in using promise and await, There is an error in console saying, I should use async keyword as well.
So clean code wow, subscribed your channel
Hello sir, what if I have a team and we need to use the same database while development then what should I use for a common db for all of us
great video, very simple and detailed, thank you
I still wonder how you are using the await keyword outside async function without error
Hey can someone explain the ? mark reason. I can’t seem to wrap my mind around it
Thanks for the video man, it was helpful for me
Great content, comprehensive enough, good pace 🙂
How to work with MySQL database in the docker container
Thank u. I more understand English talking
does the pool closes its connection after the query was completed?
what is the command to select all the function, when he was exporting them
how would you connect to the mssql rather than mysql
Great video for mysql and express v5
I've been watching a lot of tutorials on connecting MySQL to VSCode and using ExpressJS to implement it. None of the videos gave me a clear idea of what to do. But when I watched your video, you basically made everything clear to me. Just wanted to say thanks for the instructions and keep up the good work.
any one tell me the extension for code auto complete.TIA
could you extend this tutiorial with a try/catch acid transaction?
SHORT BUT ALL-IN-ONE
thanks for sharing. nice tutorial.
Man, you don't even know how this video helped me, thank you so much for the didactics and for keeping the language simple for those who aren't natives!
sabi ni classmate, panoorin daw kita. edi nice!
Which tool are you using to develop code
Hey, Thanks for putting this out but I am getting this error 'Access denied for user 'root'@'localhost' (using password: YES)". What could I be doing wrong?
gonna implement this but with postgres
Hey Sam and others,
const result = await pool.query('SELECT * FROM notes');
This results empty array for the first array of arrays. Can anyone help me.
what extension are you using that suggests you everytime autocompletion? A whole good query suggested as autocompletion and you used it. Are you kind to tell me which extension are you using please?
Absolutely amazing! So much knowledge passed through in less than 30 mins. Please keep building and keep making vids
I found an application in production and I have been tasked with creating an admin module for it. The DB is already hosted somewhere using PHPMyAdmin (I’m not sure if this statement is correct). How would I connect to it, assuming I have the IP address and the login credentials? Thanks
Hello Sam, whenever I console logged @5:15, I get SyntaxError: await is only valid in async functions. How do i get past this?
Hi! Maybe you should have said from the start that this is not a beginner friendly kind of thing. Really struggled to understand anything, but that's what you get for being a beginner in this field. Will come back to this video once I get a better grasp of MySQL. Thank you for now!
I'm curious about "const notes = await getNotes( )" works successfully, "await" syntax should be inside the async function, isn't it?
As an experienced dev, who mainly works with mongoDb, this video was amazing sir. You earned a sub
This tut helped a lot.Nice💯
how about the html file?
how to connect that?
When I run the first query as shown in your video with a similar setup, I got an error on the console that says await can only be used inside a function and top-level bodies of modules. I'm using Common JS module System, is this be a problem for this error?
Hey Bro, What is the VSC extension that shows you the suggestions as you start to type allowing you to quickly complete your code??? 🤔
watching this pretty late but I enjoyed every bit of it. I really love how you made the everything connect and how information can be accessed and modified through different channels. great work. Thanks for this.
Thanks for saving my time
Really clean, really nice!
Sam thank you! So informative and easy to follow. I couldn't find the mySQL install video in the description but I did figure it out. Still didn't know where you were running mySQL commands, I had to use MySQL Workbench.
The content i was looking for great video much appericiate❤
Does it cover the transaction concept?
Amazing video, this helped so much and was very easy to follow. Thank you!
Fantastic! I really enjoyed this honestly, I kept pausing and rewinding the clip over and over and not because it was hard to grasp rather was your delivery, absolute fire . I am so happy for accidentally coming across your channel you're a real one Sam, Cheers.
hello sir!
i have used mongodb atlas for db and I just simply go to railway and deploy my app
but how do i do this with mysql? cause mysql db is on my machine right? how to deploy mysql and nodejs server
thnks buddy
Your tutorials are fantastic! Would love to see a tutorial on AWS lambda functions and API gateway.
how to, which mysql to download?
That's the best tutorial for which i was looking for.
Understood each and every line. Thanks Sam
Very Helpful and thank you for the nice video ❤
Thank you
Thank you so much, I couldn't find anything specific to what I am trying to do, so finding this was a godsend! Interesting ideas and ways to do this
that was great class for me today
Thanks a lot, you save my first web project !!!
You are the goat
Your video is better than 99% of online formation
Yessss I agree 😎
I learned lots of things from this video than any other coding video. Thank you very much!
Is this MVVM archutecture?
Can you make a video about Passport-Local using NodeJS and MySQL ? Great video!
Great video! As a computer science student who has studied these concepts/frameworks in class, this was a fantastic streamlined refresher!
I really love your tutorial which is straightforward and clear. Especially mentioning like why it is the better way to write code. Super helpful!!
Dunno How I glad I felt at the very beginning of this tutorial, ever better jajaja dunno how to describe How I felt after complete these almost 30 minutes.
Just to try to be accurate, It was in-depth, updated, straightforward MySQL, Node.js and Express master Class...!!! Thank so much!!
Sorry I'm not english native speaker But I did my best in order to express my self!!!
In a nutshell it was spotless tutorial!!!
Thanks Dude! Thanks Sam Meech-Ward!!!!!!!!
This is straight to the point. However, how do we close connections after a successful query?
thanks you so much we love youuuu
Thank u a lot for your help. I was looking for many weeks how to connect mysql database from node Js. Now i did it !
Hi~ can I ask a basic question, how you use await without async ? I have thw same code with you but can't run in my vscode
i solved the problem by changing " type" property to "module" in package.json
It is very helpful video for those looking for 'how to connect node.js app to Mysql ". To-the-point tutorial.
💯