This is exactly what I've been looking for. It's more than 2 years old, but still answered some questions I had. Very well explained, easy to follow and extremely useful and educational.
Thank you for making this! Just what I needed to start me off with the understanding of how the various pieces fit together and then giving a worked example I can follow along with. I love the concise clear explanations, and the pacing is perfect
Theres a lot to learn from this. Thank you so much. Finally I know how to use a database with javascript. What I need to know how is making profiles so that the database has it's use so that unique users of a website have slightly different experience
wow! i've bought a bunch of udemy courses and watched trillions of tutorials. this is the first time i really felt like i've learned something that takes me one step further to being a developer
Thank you so much. It's nice to be able to put something together from start to finish. It's so helpful to actually connect to a database. This should be a springboard to bigger and better.
Thanks again for this tutorial! If you are getting this error: "ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client db disconnected", then try to change the USER in .env file to USERS and also change USER in connection in dbService to USERS. This will resolve the problem. This problem is caused as there seems to be an inbuilt variable USER in env so when a connection was made, instead of getting the specific username, the deafult USER value was used that caused this error.
I guess you are wrong The main reason why this error occurs is because when we make a new user in mysql ,it uses caching_sha2_password plugin for user authentication by default. We can check the authentication plugin for users using the command: SELECT user,plugin,host FROM mysql.user;It will show u a table like this. +------------------+-----------------------+-----------+ | user | plugin | host | +------------------+-----------------------+-----------+ | mysql.infoschema | caching_sha2_password | localhost | | mysql.session | caching_sha2_password | localhost | | mysql.sys | caching_sha2_password | localhost | | root | caching_sha2_password | localhost | | tutorial | mysql_native_password | localhost | | web_app | caching_sha2_password | localhost | +------------------+-----------------------+-----------+ According to mysql docs : The caching_sha2_password and sha256_password authentication plugins provide more secure password encryption than the mysql_native_password plugin, and caching_sha2_password provides better performance than sha256_password. Due to these superior security and performance characteristics of caching_sha2_password, it is as of MySQL 8.0 the preferred authentication plugin, and is also the default authentication plugin rather than mysql_native_password. This change affects both the server and the libmysqlclient client library: So if you have already created a user and you want to change the plugin from caching_sha2_password to mysql_native_password write the following command: ALTER USER myuser IDENTIFIED WITH mysql_native_password BY 'mypassword'; replacing myuser with username and mypassword with the password for the repective username. Another thing that you could do is to create a new user with plugin mysql_native_password. To do that you could use the following: CREATE USER 'your_user'@'your_server_ip ' IDENTIFIED WITH mysql_native_password BY 'your_password';
Yo thanks for this tutorial, the internet desperately needs more node mysql tutorials of quality like this one. Mongodb, even though I like it, seems overhyped.
at around 41:30 i start to get "ReferenceError: require is not defined" also and probably unrelated the whole time through the app sometimes runs and sometimes complains that "listen EADDRINUSE: address already in use :::5000"
Hi i wanna ask smth tht around 27:40s u changed the user name and i did too and i got this error [ ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client ]. Can u answer to my question? and i use mysql-workbench not xxamp if this can make problem?
In 29:08 in the code "return instance? instance: new dbservice" won't the instance always be null since there appears to be no code that changes it to not null if new dbservice object is created?
Sir, please tell me how did you changed in privileges as username and other things at 27:28 . I am really facing issue in my code. I am getting same error which you got early Please help🙏
In timestamp around 18:58 servers runs and shows "test". But in inspect it is showing [Uncaught ReferenceError: require is not defined] I am new to node js and i am not able to rectify it.
Thanks for the tutorial, question if I may in the insertNewName function you have resolve(result.insertId); What is .insertId please? is this a class variable from the result in connection query? Im asking because I dont set that myself anywehere. is resolve(result.affectedRows); the same as well? Thanks
Im at 27:47 I'm getting this error: error message connect ECONNREFUSED 127.0.0.1:3306 I updated the username to tutorial in mysql users and in .env. Any ideas what can I try? Im on mac if that's relevant.
Can you try checking your MySQL settings and make sure they are the same in your .env? Also if you made it this then I'm guessing you have been able to make a connection to the database already?
@@NsquaredCoding Hi, thanks for your reply! I have checked the mySQL settings and .env and as far as I can tell they are the same. Unfortunatelly I haven't been able to move past this point. If in the next 12 hours you could be available to help me trouble shoot this so I can finish this project I'll be happy to pay you through paypal. Maybe we can join a zoom channel or google hangout so I can share my screen. I wanted to send you this as a private message but youtube eliminate that option. I reached out to you on twitter too just now. Please let me know. my email is zentektv@gmail.com and twitter handle is @ZenTek_TV Thank you!
@@NsquaredCoding Having this same exact issue. Restarted XAMPP, nodemon, recreating the DB, and going through the dotenv files and haven't been able to find a solution. I also looked for your discord, but I might have missed it. Hope I can get some help.
at 1:05:50 i don't get the { id: '1' } back when I click my button. up to there everything works just like in the video. Anyone that can give me some pointers where to look? checked my code for past 2 hours but can't find the problem.
Look in the the response of the route and look into the service where it is returning the Id. I would start there. If you are having trouble try posting your code here and I can look at it.
Timestamp: 34:30 - Address (Port) Already in Use. I am receiving this error message when trying to run the first SELECT. It is reporting that the database port is already in use. The DB Server is serving other applications - the application should not be reporting this - correct? I know that I can use a mysql pool to respond to db requests - can you share how the code would change by using a Pool instead of connection?
thank you for video!!! tutorial so cool !!!! it will be great if someday you make tutorial about authorization in nodeJS with mysql !!! Thanks a lot !!!!!!!
Can anyone help me, at 46:55 im having this error : " Cannot destructure property 'name' of 'request.body' as it is undefined". I managed more than 2 hours but couldnt figure out the solution, many thanks.
I want to know that how can you show the data of the row you are editing in edit row input meaning i want that when i click on edit button the value of that row should be filled in the input
It is a very good tutorial! I have some issues. can you help me? I dont know why but document.querySelector('table tbody') dont work 10:15 but if i use document.getElementById('tablebody') and add id to table body it works... how to solve this?
@@NsquaredCoding Thank you so much for your quick response! Yeah, that solved my problem. But I still need to specify otherwise document.querySelector ('# table-Body') doesn't work. I don't understand, because for you and everyone here have everything working as it should, no one has any questions on this. It is difficult to study JS when faced with a similar misunderstanding of the problem
34:00 for some damn reason `console.log(response) is printing the response twice and I have no idea why. The 2nd log comes about half a second after the first. EDIT: Turns out that all the network connections (network tab of dev tools) were being duplicated and this was being cause by the 'Live Preview' extension in VSCode. Microsoft gaslighting me into thinking I'm crazy for a solid 20 minutes.
Hi NSquared Coding, when I run 'nodemon app,' it's saying the command isn't found. I've done npm install 'nodemon --save-dev' Do you know why this isn't working?
I installed it like this 'npm install --save nodemon" and my package.json is like this: "name": "server", "version": "1.0.0", "description": "", "main": "server.js", "scripts": { "start": "nodemon index.js", "devStart": "nodemon index.js", "test": "echo \"Error: no test specified\" && exit 1" make you're in 'server' folder to run command 'npm start'
Thank you for the video. Although I do have problem and that is that I can't display or console.log the insertId. It returns as undefined. Yet in xampp I can view it.
I wish there's a shortcut to refresh the page instead adding code between 52:06 -1:00:48. Now I see why people choose React or Vue instead of plain HTML with javascript. In React, all you need is useEffect() to refresh. Anyway, 52:48 I don't know how MySql INSERT statement return id. Does it return inserted id by default? Also, anyone can explain this: data['data'] what does it mean? Where is '.no-data' in index.html?
You're right, a client side framework definitely has its advantages in these cases. Yes you will get an insert id back when you execute an insert operation. Data is an object and inside that object there is a key that is also called data. We are accessing that key inside the data object. I believe .no-data is being inserted dynamically from Javascript. I'll need to look at the code to double check.
@@NsquaredCoding Thank you so much. Sorry for causing confusion. '.no-data' is in loadingHTMLtable function. I was focusing too much on Insert function that I forgot 'no-data' is dynamic table.
Hi, could you help me with a situation i was running nodemon app but i got the problem "[nodemon] app crashed - waiting for file changes before starting..." may you have idea how to fix this?
There must be an error in one of your files which may be crashing it. Try to stop the server and then restart it if you believe there aren't any errors.
For some reason, when I try to add a new user to give privileges to the database, the checkbox: "Grant all privileges on database web_app" is missing. The first two checkboxes are there, but not the one I actually need checked. Because of that, the app will not connect unless I change the username of the new account in phpMyAdmin to my actual local username in my computer. Otherwise, if I change the name to 'tutorial', it won't work. Any help would be appreciated. Thanks!
Thanks for this course... should've found it months ago. I'm having trouble with mysql and mysql2 imports and exports. Is there somewhere I could get the complete finished code?
This is probably a silly question, but i'm a newbie. What languages (i.e. Javascript) would I need to learn to full understand the programming concepts/syntax behind this video?
No silly questions! I'm happy to help. Mostly JavaScript for the client side in the browser and then in the backend as well for using the Node runtime. Then there is MySQL which is a query language for the database. For the web page you'll need to know HTML to build the table and CSS to style your HTML like changing the color for example.
Loved this tutorial. Still the best out there for node js with mysql. I was able to modify this to add football players and stats to a data base and filter across any stat. Now I have it working great I just a little stuck on how to deploy It so my group of 20 friends can access it without a monthly fee for hosting the database. Any thoughts or videos on self hosting this app?
On beginning of the video when you present demo of this application on first udpate is not refreshing the page but on second update action is refreshing the page, what is the difference?
Hmm I saw that, it might have happened really fast. In this project it should refresh the page when clicking on update. There should be no difference. I hope that clears up any confusion.
Hi, thanks for your explanation.. i am confused that how nodejs and apache webserver runs on the same server? Does it affect performance? Is it possible to deploy nodejs and mysql without apache?
Awesome bro..this type tutorial i prefer..backend and front explain..simple to understand!!keep it up bro.. and i got question..can we connect from multiple db in 1 server and how to declare it.
I'm glad you liked it! Yeah we can definitely connect to more than 1 db in the server. I know I always set the db in my config. One way you can connect to multiple dbs is have multiple connection files specific to what db want you want to connect to.
@@NsquaredCoding example i have 2 app..one using wordpress and codigniter.i need my user can access both in 1 user acc.how to make auth global.if posible guide with login/registration too...hehehe..thanks
On update I've got this error " uncaught ( in promise) TypeError: Failed to fetch" have worked with headers: { 'Content- type': 'application/json' } & still not working. why?
Could you build the same api using MySql Workbench, and also conduct all back-end and front-end functionalities in one js file? Its a little confusing .env file as I haven't used that in my last task where I created a dynamic webpage using mongodb. Was just wondering as I wanted to do it easier way. Thanks.
Hi there! Yeah check the response variable. You can add a console.log to see that. It is most likely undefined that is why the error is being thrown. There may something when the query is being executed. You may want to start there. I hope this helps!
In my case MySQL query was wrong. Check if column names in your database are exacly the same in query, so you have name column, and date_added column (or copy names from DB to query) and also check if table name is exacly the same in query as in DB. Hope it helps.
Hello great tutorial and all but at the update part the section where you added the header on the fetch of updatebtn. When I followed it I’m only getting the name and not the id of updateNameInput. How to fix this :(
@@NsquaredCoding Oh, sorry I could've updated the the post. You had no typo. I paid less attention in-between. I went backwards in the video to be sure and realised that you had clicked on "open with live server", thats why you got another port number than the one used in the tutorial. It's all working fine for me now. Thanks for taking time and reply.
That will start your backend server. You need to creat an html file with a JavaScript file that will be included in your html file. Open the html file in your browser and you should be good to go.
Just discovered your channel, your tutorials are awesome! Would you consider making email registration and login for this system to fully round out the app? Thanks for your time and knowledge.
@@NsquaredCoding when I'm running console.log("app is running at " + process.env.DB_PORT) Output is : app is running at undefined. Can you pls figure out what's the problem??
sqlMessage: 'Client does not support authentication protocol requested by server; consider upgrading MySQL client', I'm getting this error what should i do?
Try this: This code doesn't do much. It just test mysql connection. If it works, then your connection is fine and you can continue doing other MySql queries. dotenv.config(); //Connection Configuaration/************************* const conLink = { host: process.env.HOST, user: process.env.USER, password: process.env.PASSWORD, database: process.env.DATABASE, port: process.env.DB_PORT, insecureAuth : true, }; const db = mysql.createConnection(conLink); db.connect(function(err) { if (err) { console.log('There is error', err.message); } else { console.log("Database Connected!"); } });
This is very helpful but my dbService also got disconnected but mine didnt tell me anything about passwords and stuff like that just in the terminal it said dbdisconnected
Hey man, thanks for this cool project. I was wondering if no data found in the search input, it should say "No Data Found" but in the tutorial you didn't implement that. I coulnd't figure out the implementation.
#HELP i have error like that ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
If you have any trouble with nodemon saying "nodemon: command not found", I found this Stack Overflow answer which helped me... ``` npx nodemon [your-app.js] ``` With a local installation, nodemon will not be available in your system path. Instead, the local installation of nodemon can be run by calling it from within an npm script (such as `npm start`) or using `npx nodemon`.
@@NsquaredCoding Hi, I was able to fix my problem with delete. I would like to ask if you can help me with the edit part since I wanted to use the add textinput and button. Also thank you for this tutorial.
@@NsquaredCoding with the edit function that you created, you added a section, what I would like to know if we can use the addtextinput and addbutton instead of using the section hidden?
Hi, nice tutorial it helps me a lot. I have a smal problem. So in the tabel on my webseit the name is showd but the id and Date will be showd with undefind. I do not realy now the problem. If I want to parse the Date it says invalid Date. I hope some one can help me. Thx
This is exactly what I've been looking for. It's more than 2 years old, but still answered some questions I had. Very well explained, easy to follow and extremely useful and educational.
I'm glad it was helpful!
Thank you for making this! Just what I needed to start me off with the understanding of how the various pieces fit together and then giving a worked example I can follow along with. I love the concise clear explanations, and the pacing is perfect
Theres a lot to learn from this. Thank you so much.
Finally I know how to use a database with javascript.
What I need to know how is making profiles so that the database has it's use
so that unique users of a website have slightly different experience
You're very welcome!
I need that too
@@sekokhan5307 how are you now?
wow! i've bought a bunch of udemy courses and watched trillions of tutorials.
this is the first time i really felt like i've learned something that takes me one step further to being a developer
I am so happy to hear this tutorial helped you! Keep going!
are we using rest api here ????
Thank you so much. It's nice to be able to put something together from start to finish. It's so helpful to actually connect to a database. This should be a springboard to bigger and better.
You're welcome! I'm glad it was helpful!
we need more apps like this , thank you man ♥
Absolutely I will create more tutorials revolving about full stack web development.
I was hoping adding React Redux to this would have made it a hit
This tutorial was extremely interesting and helpful. By far the best explanation of how to use mySQL with Node Js. Thank you very much! :)
You're very welcome :)
don't hesitate to make more of this. really good, and easy to understand.
I’m open to suggestions if you want to see a video on something specific.
You deserve more attention than all those of 300k sub channel owners - thank you for this tutorial
Wow I really appreciate that! Thank you
been searching for this for over a week, thank you very much
Great tutorial, addressed my needs directly without a drop of wasted time.
Thank you I really appreciate it!
Bole to...jhkas...... converting .then to....async await.... loving it ❤️
best tutorial on youtube hands down
my console.log(response) at 34:06 is not printing the empty array in console.. I have written same code.. please help me out
any solutions?
18:00 followed everything up to this point and when I say nodemon app it says command not found. What do I do now?
Thanks again for this tutorial!
If you are getting this error: "ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
db disconnected",
then try to change the USER in .env file to USERS and also change USER in connection in dbService to USERS. This will resolve the problem.
This problem is caused as there seems to be an inbuilt variable USER in env so when a connection was made, instead of getting the specific username, the deafult USER value was used that caused this error.
I guess you are wrong The main reason why this error occurs is because when we make a new user in mysql ,it uses caching_sha2_password plugin for user authentication by default. We can check the authentication plugin for users using the command: SELECT user,plugin,host FROM mysql.user;It will show u a table like this.
+------------------+-----------------------+-----------+
| user | plugin | host |
+------------------+-----------------------+-----------+
| mysql.infoschema | caching_sha2_password | localhost |
| mysql.session | caching_sha2_password | localhost |
| mysql.sys | caching_sha2_password | localhost |
| root | caching_sha2_password | localhost |
| tutorial | mysql_native_password | localhost |
| web_app | caching_sha2_password | localhost |
+------------------+-----------------------+-----------+
According to mysql docs :
The caching_sha2_password and sha256_password authentication plugins provide more secure password encryption than the mysql_native_password plugin, and caching_sha2_password provides better performance than sha256_password. Due to these superior security and performance characteristics of caching_sha2_password, it is as of MySQL 8.0 the preferred authentication plugin, and is also the default authentication plugin rather than mysql_native_password. This change affects both the server and the libmysqlclient client library:
So if you have already created a user and you want to change the plugin from caching_sha2_password to mysql_native_password write the following command:
ALTER USER myuser IDENTIFIED WITH mysql_native_password BY 'mypassword';
replacing myuser with username and mypassword with the password for the repective username.
Another thing that you could do is to create a new user with plugin mysql_native_password. To do that you could use the following:
CREATE USER 'your_user'@'your_server_ip ' IDENTIFIED WITH mysql_native_password BY 'your_password';
Yo thanks for this tutorial, the internet desperately needs more node mysql tutorials of quality like this one. Mongodb, even though I like it, seems overhyped.
Absolutely! Thank you so much!
I will definitely add more tutorials with mysql. Usually all my tutorials with a database will be with mysql.
I agree
Your video was really helpful it got me out of a very serious problem i cannot thank you enough :)
You're welcome! I'm glad it helped you solve your problem!
Awesome sir,
Thanks for such detailed explanation in 90 min, It really helps alot
You're very welcome!
It's awsome bro, easy t follow. Thank you
at around 41:30 i start to get "ReferenceError: require is not defined" also and probably unrelated the whole time through the app sometimes runs and sometimes complains that "listen EADDRINUSE: address already in use :::5000"
Hi i wanna ask smth tht around 27:40s u changed the user name and i did too and i got this error [ ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client ]. Can u answer to my question? and i use mysql-workbench not xxamp if this can make problem?
Wow, awesome tutorial, you have a nice voice-concise and understandable explanation. Thank you for sharing your video. God bless you....
You're very welcome!! I'm glad it was helpful. Thank you for such a nice compliment.
Thank you very much, this video helped me to build a full-stack application for my final-year project and I got A
I'm happy to hear that!
Hey man, thanks for the tutorial, it was my first crud and you really helped me out.
I'm happy to hear that!
In 29:08
in the code "return instance? instance: new dbservice"
won't the instance always be null since there appears to be no code that changes it to not null if new dbservice object is created?
Yes you are right! Silly mistake on my part. It should be returning the variable after we set the new instance to the variable.
truly appreciated this. great tempo, explanation, utility
When I start to add code after 17:00 No Data in the table disappear I don't know what is the problem
Sir, please tell me how did you changed in privileges as username and other things at 27:28 . I am really facing issue in my code. I am getting same error which you got early
Please help🙏
Thank you man for this amazing tutorial. Really helped for a project I am working on! Keep up the nice work!
My addBtn is giving me error on my browser console any idea how I can fix this
In timestamp around 18:58 servers runs and shows "test". But in inspect it is showing [Uncaught ReferenceError: require is not defined]
I am new to node js and i am not able to rectify it.
Can you paste app.js code here where you are using require
Thanks for the tutorial, question if I may
in the insertNewName function you have
resolve(result.insertId);
What is .insertId please? is this a class variable from the result in connection query? Im asking because I dont set that
myself anywehere.
is resolve(result.affectedRows); the same as well?
Thanks
Im at 27:47 I'm getting this error: error message connect ECONNREFUSED 127.0.0.1:3306 I updated the username to tutorial in mysql users and in .env. Any ideas what can I try? Im on mac if that's relevant.
Can you try checking your MySQL settings and make sure they are the same in your .env?
Also if you made it this then I'm guessing you have been able to make a connection to the database already?
@@NsquaredCoding Hi, thanks for your reply! I have checked the mySQL settings and .env and as far as I can tell they are the same. Unfortunatelly I haven't been able to move past this point. If in the next 12 hours you could be available to help me trouble shoot this so I can finish this project I'll be happy to pay you through paypal. Maybe we can join a zoom channel or google hangout so I can share my screen. I wanted to send you this as a private message but youtube eliminate that option. I reached out to you on twitter too just now. Please let me know. my email is zentektv@gmail.com and twitter handle is @ZenTek_TV Thank you!
Hi, sorry I didn't get to reply sooner! I was thinking I could make a discord channel and I could help you on there! I would love to help.
@@NsquaredCoding Having this same exact issue. Restarted XAMPP, nodemon, recreating the DB, and going through the dotenv files and haven't been able to find a solution. I also looked for your discord, but I might have missed it. Hope I can get some help.
Awesome ! you are among the best !
Thank you so much! That means a lot
at 1:05:50 i don't get the { id: '1' } back when I click my button. up to there everything works just like in the video.
Anyone that can give me some pointers where to look? checked my code for past 2 hours but can't find the problem.
Look in the the response of the route and look into the service where it is returning the Id. I would start there. If you are having trouble try posting your code here and I can look at it.
You get data-id={id} instead of actual id right?
Try this in loadHTMLTable:
tableHTML += `
Did you fix this problem?
Timestamp: 34:30 - Address (Port) Already in Use. I am receiving this error message when trying to run the first SELECT. It is reporting that the database port is already in use. The DB Server is serving other applications - the application should not be reporting this - correct? I know that I can use a mysql pool to respond to db requests - can you share how the code would change by using a Pool instead of connection?
thank you for video!!! tutorial so cool !!!! it will be great if someday you make tutorial about authorization in nodeJS with mysql !!! Thanks a lot !!!!!!!
You're welcome! I really appreciate this comment! I will definitely make a video about auth with nodejs and MySQL.
Check out The NetNinja, he's cool too
Thank you so much. its helped me a lot for DRY code rules.
Can anyone help me, at 46:55 im having this error : " Cannot destructure property 'name' of 'request.body' as it is undefined". I managed more than 2 hours but couldnt figure out the solution, many thanks.
Make sure you check your fetch body in the frontend Js. You can also go to the network tab in your browser and check the post data.
I want to know that how can you show the data of the row you are editing in edit row input meaning i want that when i click on edit button the value of that row should be filled in the input
Amazing video and super informative! Thank you😁!
It was so great and helpful, many thanks for this tutorial!
You're very welcome!
It is a very good tutorial!
I have some issues. can you help me? I dont know why but document.querySelector('table tbody') dont work 10:15
but if i use document.getElementById('tablebody') and add id to table body it works... how to solve this?
Inside your query selector you need to #
In front to specify it's an id you're looking for. That should fix it!
@@NsquaredCoding Thank you so much for your quick response! Yeah, that solved my problem. But I still need to specify otherwise document.querySelector ('# table-Body') doesn't work. I don't understand, because for you and everyone here have everything working as it should, no one has any questions on this. It is difficult to study JS when faced with a similar misunderstanding of the problem
I'm using postgresql for this project and on 33:56 I get ReferenceError: instance is not defined
did you ever find a solution to this?
34:00 for some damn reason `console.log(response) is printing the response twice and I have no idea why. The 2nd log comes about half a second after the first.
EDIT: Turns out that all the network connections (network tab of dev tools) were being duplicated and this was being cause by the 'Live Preview' extension in VSCode. Microsoft gaslighting me into thinking I'm crazy for a solid 20 minutes.
Just a short question, to import the package, what if we use powershell or cmd instead of bash. Anyone knows?
man, you did awesome job, thanks and greats and congratulations:)
Thank you so much!
Excellent tutorial. Thank you.
Great tutorial thanks. i just subbed. keep going man
Thank you! That means a lot
Hi NSquared Coding, when I run 'nodemon app,' it's saying the command isn't found. I've done npm install 'nodemon --save-dev' Do you know why this isn't working?
Can you look in your packages.json file to make sure it is installed and you are in the same directory where the packages.json file is
I installed it like this 'npm install --save nodemon"
and my package.json is like this:
"name": "server",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"start": "nodemon index.js",
"devStart": "nodemon index.js",
"test": "echo \"Error: no test specified\" && exit 1"
make you're in 'server' folder to run command 'npm start'
the 1:25 issue in my case was in unpadteBtn.onClick's id was being taken from input's dataset.id but should have taken from button's
Same issue and your comment was a life saver God bless
Thank you for the video. Although I do have problem and that is that I can't display or console.log the insertId. It returns as undefined. Yet in xampp I can view it.
I wish there's a shortcut to refresh the page instead adding code between 52:06 -1:00:48.
Now I see why people choose React or Vue instead of plain HTML with javascript. In React, all you need is useEffect() to refresh.
Anyway, 52:48 I don't know how MySql INSERT statement return id. Does it return inserted id by default?
Also, anyone can explain this: data['data'] what does it mean? Where is '.no-data' in index.html?
You're right, a client side framework definitely has its advantages in these cases.
Yes you will get an insert id back when you execute an insert operation.
Data is an object and inside that object there is a key that is also called data. We are accessing that key inside the data object.
I believe .no-data is being inserted dynamically from Javascript. I'll need to look at the code to double check.
@@NsquaredCoding Thank you so much. Sorry for causing confusion. '.no-data' is in loadingHTMLtable function. I was focusing too much on Insert function that I forgot 'no-data' is dynamic table.
Hi, could you help me with a situation i was running nodemon app but i got the problem "[nodemon] app crashed - waiting for file changes before starting..." may you have idea how to fix this?
There must be an error in one of your files which may be crashing it. Try to stop the server and then restart it if you believe there aren't any errors.
do i need to install dotenv? I'm getting error "Missing destination operand".
For some reason, when I try to add a new user to give privileges to the database, the checkbox: "Grant all privileges on database web_app" is missing. The first two checkboxes are there, but not the one I actually need checked.
Because of that, the app will not connect unless I change the username of the new account in phpMyAdmin to my actual local username in my computer. Otherwise, if I change the name to 'tutorial', it won't work.
Any help would be appreciated. Thanks!
How would I host a full stack app? Do I need to host the server side code somewhere and then host the client side stuff some place else??
Thanks a bunch for posting it! I'm also wanting to learn to do the same. I haven't hosted a full stack app myself either. I will read into this.
hosting on Heroku is great for full stack apps
@@JenniferStewart100 Can you help me out with how to host it on heroku
Did any of you guys end up hosting this project somewhere? I'm trying to do the same thing and could use some advice if either of you did.
Thanks for this course... should've found it months ago.
I'm having trouble with mysql and mysql2 imports and exports. Is there somewhere I could get the complete finished code?
This is probably a silly question, but i'm a newbie. What languages (i.e. Javascript) would I need to learn to full understand the programming concepts/syntax behind this video?
No silly questions! I'm happy to help.
Mostly JavaScript for the client side in the browser and then in the backend as well for using the Node runtime.
Then there is MySQL which is a query language for the database.
For the web page you'll need to know HTML to build the table and CSS to style your HTML like changing the color for example.
19:27 i am getting an TypeError of cannot read property of 'get' of undefined
Can anyone help?
Please show some code that you wrote. It's hard to tell what causes the error.
Loved this tutorial. Still the best out there for node js with mysql. I was able to modify this to add football players and stats to a data base and filter across any stat. Now I have it working great I just a little stuck on how to deploy It so my group of 20 friends can access it without a monthly fee for hosting the database. Any thoughts or videos on self hosting this app?
On beginning of the video when you present demo of this application on first udpate is not refreshing the page but on second update action is refreshing the page, what is the difference?
Hmm I saw that, it might have happened really fast.
In this project it should refresh the page when clicking on update. There should be no difference. I hope that clears up any confusion.
Nsquared Coding it can be in real time add, edit, remove? Like firebase.
HELP!! Captians
process.env.HOST is undefined
how to fix it?
Check if HOST is defined in your .env file
You helped me a lot, god bless you thanks!
You're very welcome!
After doing everything, i keep getting the error 'data is not defined'... i did everything as you did.
Useful content!
Hi, thanks for your explanation.. i am confused that how nodejs and apache webserver runs on the same server? Does it affect performance? Is it possible to deploy nodejs and mysql without apache?
This DbService its exactly what i am searching for! Thank you a lot!
You're very welcome!
Awesome bro..this type tutorial i prefer..backend and front explain..simple to understand!!keep it up bro..
and i got question..can we connect from multiple db in 1 server and how to declare it.
I'm glad you liked it!
Yeah we can definitely connect to more than 1 db in the server. I know I always set the db in my config.
One way you can connect to multiple dbs is have multiple connection files specific to what db want you want to connect to.
@@NsquaredCoding example i have 2 app..one using wordpress and codigniter.i need my user can access both in 1 user acc.how to make auth global.if posible guide with login/registration too...hehehe..thanks
On update I've got this error " uncaught ( in promise) TypeError: Failed to fetch" have worked with headers: { 'Content- type': 'application/json' } & still not working. why?
solved i found that i didn't set id well to the edited raw
Could you build the same api using MySql Workbench, and also conduct all back-end and front-end functionalities in one js file? Its a little confusing .env file as I haven't used that in my last task where I created a dynamic webpage using mongodb. Was just wondering as I wanted to do it easier way. Thanks.
HI. can you please tell me how i can modify this code to add a dropdown menu instead of a table?
Hii, i'm getting the following error while adding name:
TypeError: Cannot read property 'insertId' of undefined at Query.
Can you please help?
Hi there! Yeah check the response variable. You can add a console.log to see that. It is most likely undefined that is why the error is being thrown. There may something when the query is being executed. You may want to start there. I hope this helps!
Am getting this issue and I have made sure the code is same as yours but still the same error comes up...can you kindly assist me?
Hi there!
I was getting the same error. Realised that it was caused due to an error in SQL syntax. Do check it if it if there is an error like this.
Did anyone get passed through this error?
In my case MySQL query was wrong. Check if column names in your database are exacly the same in query, so you have name column, and date_added column (or copy names from DB to query) and also check if table name is exacly the same in query as in DB. Hope it helps.
Nice tutorial, subscribed 👍
Thank you!
Getting error something like " promise is not defined" can u plzz help
Hello great tutorial and all but at the update part the section where you added the header on the fetch of updatebtn. When I followed it I’m only getting the name and not the id of updateNameInput. How to fix this :(
If I remember correctly the Id is being set in the html element. Are you see it there in the Dom?
how did you solve this?
Thank you ! it was a really good tutorial.
You're welcome! I'm glad it was helpful!
I just wonder why you used port 5501 in the url and declare 5000 in the app? This does not add up for me since I get error.
Thank you!
I don't remember using 5501. It could be a typo on my end in the video.
@@NsquaredCoding Oh, sorry I could've updated the the post.
You had no typo. I paid less attention in-between.
I went backwards in the video to be sure and realised that you had clicked on "open with live server", thats why you got another port number than the one used in the tutorial.
It's all working fine for me now.
Thanks for taking time and reply.
how to start frontend? i start it with nodemon index.js and get this error ReferenceError: document is not defined
That will start your backend server. You need to creat an html file with a JavaScript file that will be included in your html file. Open the html file in your browser and you should be good to go.
do you have a new one ?, its been for years so i need a new update of these code, hope you can help me, your video is very useful.
Just discovered your channel, your tutorials are awesome! Would you consider making email registration and login for this system to fully round out the app? Thanks for your time and knowledge.
Great tutorial !!!!!
Thank you very much!
Finished Thanks a lot ❤ sir
You're welcome!
thanks for this amazing tutorial
No problem!
Can you update this please for mysql 2 and pools?
Hello
I am newer to NODE and I am getting this error when I try to pst
TypeError: Cannot read property 'insertId' of undefined
Were you able to resolve the problem?
The reason this is happening is because the response variable you are trying to access insertId is undefined.
Facing an issue
It's showing app is running on terminal but on what localhost is it running?
I've tried 5000 but nothing happened!!
Are you entering localhost:5000 in your browser and an error is being throw? You can run console.log to see what the error is?
@@NsquaredCoding when I'm running console.log("app is running at " + process.env.DB_PORT)
Output is : app is running at undefined.
Can you pls figure out what's the problem??
sqlMessage: 'Client does not support authentication protocol requested by server; consider upgrading MySQL client', I'm getting this error what should i do?
What software are you using to create a DB server?
Try this: This code doesn't do much. It just test mysql connection.
If it works, then your connection is fine and you can continue doing other MySql queries.
dotenv.config();
//Connection Configuaration/*************************
const conLink = {
host: process.env.HOST,
user: process.env.USER,
password: process.env.PASSWORD,
database: process.env.DATABASE,
port: process.env.DB_PORT,
insecureAuth : true,
};
const db = mysql.createConnection(conLink);
db.connect(function(err) {
if (err) {
console.log('There is error', err.message);
}
else {
console.log("Database Connected!");
}
});
This is very helpful but my dbService also got disconnected but mine didnt tell me anything about passwords and stuff like that just in the terminal it said dbdisconnected
Hey man, thanks for this cool project. I was wondering if no data found in the search input, it should say "No Data Found" but in the tutorial you didn't implement that. I coulnd't figure out the implementation.
Did someone also had problems with implementing the code ? my buttons are not working/showing at all, i am not sure where exactly the problem is.
I am getting zsh: command not found: nodemon
how can I fix this error.
Did you install nodemon? That's probably why it is giving you that message.
@@NsquaredCoding I had to use npm install -g nodemon to install nodemon instead of npm install --save-dev nodemon. It works now. Thanks
#HELP
i have error like that
ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
Thank You so mutch for this video! It's so helpfull :)
You're very welcome!
Great tutorial
I'm glad you liked it!
If you have any trouble with nodemon saying "nodemon: command not found", I found this Stack Overflow answer which helped me...
```
npx nodemon [your-app.js]
```
With a local installation, nodemon will not be available in your system path. Instead, the local installation of nodemon can be run by calling it from within an npm script (such as `npm start`) or using `npx nodemon`.
How can we hash password in sql it is possible ? Or not
Hi, i got a question on delete, since I didnt added the date? how can I make my entries as an array list?
Hi! I couldn't understand your question entirely. Could you explain in further detail please?
@@NsquaredCoding Hi, I was able to fix my problem with delete. I would like to ask if you can help me with the edit part since I wanted to use the add textinput and button. Also thank you for this tutorial.
I can definitely help. What are you having trouble with?
@@NsquaredCoding with the edit function that you created, you added a section, what I would like to know if we can use the addtextinput and addbutton instead of using the section hidden?
Hi, nice tutorial it helps me a lot.
I have a smal problem. So in the tabel on my webseit the name is showd but the id and Date will be showd with undefind. I do not realy now the problem.
If I want to parse the Date it says invalid Date.
I hope some one can help me.
Thx
Thank you 👍🏼🙏, subscribed ❤️
You're welcome! Thank you for subscribing!