Node js mysql npm install mysql var mysql = require(‘mysql’); var con = mysql.createConnection({ host: “localhost”, user: “root”, password: “” }); con.connect(function(err) { if (err) throw err; console.log(“Connected!”); }); Cook with me Share this content Opens in a new window X Opens in a new window Facebook Opens in a new window WhatsApp You Might Also Like Where condition in node js mysql August 23, 2023 File system in node js ( Read file ) August 22, 2023 Delete query in node js mysql August 23, 2023 Leave a Reply Cancel replyCommentEnter your name or username to comment Enter your email address to comment Enter your website URL (optional) Save my name, email, and website in this browser for the next time I comment.