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!”); }); You Might Also Like Create files in node js August 22, 2023 Create table using nodejs August 23, 2023 File system in node js ( Read file ) August 22, 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.