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 Nodemailler module in node js August 22, 2023 Create database using nodejs August 23, 2023 Insert data using 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.